Fires immediately before the logged-in authentication cookie is set.


do_action( 'set_logged_in_cookie', (string) $logged_in_cookie, (int) $expire, (int) $expiration, (int) $user_id, (string) $logged_in ); 

Parameters (5)

0. $logged_in_cookie (string)
The logged in cookie.
1. $expire (int)
The time the login grace period expires as a UNIX timestamp. Default is 12 hours past the cookie's expiration time.
2. $expiration (int)
The time when the logged-in authentication cookie expires as a UNIX timestamp. Default is 14 days from now.
3. $user_id (int)
The user id.
4. $logged_in (string) => 'logged_in'
Authentication scheme. Default logged_in..


To run the hook, copy the example below.
  1. // run the action 
  2. do_action( 'set_logged_in_cookie', $logged_in_cookie, $expire, $expiration, $user_id, $logged_in ); 
The following example is for adding a hook callback.
  1. // define the set_logged_in_cookie callback 
  2. function action_set_logged_in_cookie( $logged_in_cookie, $expire, $expiration, $user_id, $logged_in ) { 
  3. // make action magic happen here... 
  4. }; 
  6. // add the action 
  7. add_action( 'set_logged_in_cookie', 'action_set_logged_in_cookie', 10, 5 ); 
To remove a hook callback, use the example below.
  1. // remove the action 
  2. remove_action( 'set_logged_in_cookie', 'action_set_logged_in_cookie', 10, 5 ); 

Defined (1)

The action is defined in the following location(s).

  1. do_action( 'set_logged_in_cookie', $logged_in_cookie, $expire, $expiration, $user_id, 'logged_in' );