WPDev.one
Core Function
View Source on Trac ↗

wp_generate_auth_cookie()

wp_generate_auth_cookie( mixed $user_id, mixed $expiration, mixed $scheme = 'auth', mixed $token = '' )

Generates authentication cookie contents.

Parameters 3 required

Name / Type Description
$user_id
int

User ID.

Required
$expiration
int

The time the cookie expires as a UNIX timestamp.

Required
string

$scheme Optional. The cookie scheme to use: 'auth', 'secure_auth', or 'logged_in'. Default 'auth'.

Required
$token
string

User's session token to use for this cookie.

Return Value

(string)
Authentication cookie contents. Empty string if user does not exist.

Function Information

Since Version
2.5.0
Source File
wp-includes/pluggable.php
Advertisement