set_logged_in_cookie
Action HookDescription
Fires immediately before the logged-in authentication cookie is set.Hook Information
File Location |
wp-includes/pluggable.php
View on GitHub
|
Hook Type | Action |
Line Number | 1086 |
Hook Parameters
Type | Name | Description |
---|---|---|
string
|
$logged_in_cookie
|
The logged-in cookie value. |
int
|
$expire
|
The time the login grace period expires as a UNIX timestamp. Default is 12 hours past the cookie's expiration time. |
int
|
$expiration
|
The time when the logged-in authentication cookie expires as a UNIX timestamp. Default is 14 days from now. |
int
|
$user_id
|
User ID. |
string
|
$scheme
|
Authentication scheme. Default 'logged_in'. |
string
|
$token
|
User's session token to use for this cookie. |
Usage Examples
Basic Usage
<?php
// Hook into set_logged_in_cookie
add_action('set_logged_in_cookie', 'my_custom_function', 10, 6);
function my_custom_function($logged_in_cookie, $expire, $expiration, $user_id, $scheme, $token) {
// Your custom code here
}
Source Code Context
wp-includes/pluggable.php:1086
- How this hook is used in WordPress core
<?php
1081 * Default is 14 days from now.
1082 * @param int $user_id User ID.
1083 * @param string $scheme Authentication scheme. Default 'logged_in'.
1084 * @param string $token User's session token to use for this cookie.
1085 */
1086 do_action( 'set_logged_in_cookie', $logged_in_cookie, $expire, $expiration, $user_id, 'logged_in', $token );
1087
1088 /**
1089 * Allows preventing auth cookies from actually being sent to the client.
1090 *
1091 * @since 4.7.4
PHP Documentation
<?php
/**
* Fires immediately before the logged-in authentication cookie is set.
*
* @since 2.6.0
* @since 4.9.0 The `$token` parameter was added.
*
* @param string $logged_in_cookie The logged-in cookie value.
* @param int $expire The time the login grace period expires as a UNIX timestamp.
* Default is 12 hours past the cookie's expiration time.
* @param int $expiration The time when the logged-in authentication cookie expires as a UNIX timestamp.
* Default is 14 days from now.
* @param int $user_id User ID.
* @param string $scheme Authentication scheme. Default 'logged_in'.
* @param string $token User's session token to use for this cookie.
*/
Quick Info
- Hook Type: Action
- Parameters: 6
- File: wp-includes/pluggable.php
Related Hooks
Related hooks will be displayed here in future updates.