WordPress.org

Codex

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

Function Reference/wp set auth cookie

Description

This function can be replaced via plugins. If plugins do not redefine these functions, then this will be used instead.

Sets the authentication cookies based User ID.

The $remember parameter increases the time that the cookie will be kept. The default the cookie is kept without remembering is two days. When $remember is set, the cookies will be kept for 14 days or two weeks.

Usage

<?php wp_set_auth_cookie$user_id$remember$secure ?>

Parameters

$user_id
(integer) (required) User ID
Default: None
$remember
(boolean) (optional) Whether to remember the user or not
Default: false
$secure
(unknown) (optional)
Default: ''

Return Values

(void) 
This function does not return a value.

Examples

Notes

  • This function can be replaced via plugins. If plugins do not redefine these functions, then this will be used instead.

Change Log

Since: 2.5

Source File

wp_set_auth_cookie() is located in wp-includes/pluggable.php.

Related

See also index of Function Reference and index of Template Tags.