WordPress.org

Codex

Attention Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Plugin API/Action Reference/set auth cookie

Description

set_auth_cookie is an action that fires immediately before the user authentication cookie is set.

Parameters

$auth_cookie
(string) (required) Authentication cookie.
Default: None
$expire
(int) (required) Login grace period in seconds. Default 43,200 seconds, or 12 hours.
Default: None
expiration
(int) (required) Duration in seconds the authentication cookie should be valid. Default 1,209,600 seconds, or 14 days.
Default: None
$user_ID
(int) (required) User ID.
Default: None
$scheme
(string) (required) Authentication scheme. Values include 'auth', 'secure_auth', or 'logged_in'.
Default: None

Examples

add_action( 'set_auth_cookie', 'my_cookie_action', 10, 5 );
function my_cookie_action( $auth_cookie, $expire, $expiration, $user_id, $scheme ) {
    // complete some action when the cookie is set.
    return;
}

Change Log

Since: Version 2.5

Source File

set_auth_cookie is located in wp-includes/pluggable.php

Related