set_auth_cookie WordPress Action Hook
The set_auth_cookie hook is called whenever a user logs in to WordPress. It allows you to set the authentication cookie for the user, which is used to remember the user's login information.
do_action( 'set_auth_cookie', string $auth_cookie , int $expire , int $expiration , int $user_id , string $scheme , string $token ) #
Fires immediately before the authentication cookie is set.
Parameters
- $auth_cookie
(string)Authentication cookie value.
- $expire
(int)The time the login grace period expires as a UNIX timestamp. Default is 12 hours past the cookie's expiration time.
- $expiration
(int)The time when the authentication cookie expires as a UNIX timestamp. Default is 14 days from now.
- $user_id
(int)User ID.
- $scheme
(string)Authentication scheme. Values include 'auth' or 'secure_auth'.
- $token
(string)User's session token to use for this cookie.
Source
Changelog
Version | Description |
---|---|
4.9.0 | The $token parameter was added. |
2.5.0 | Introduced. |