Ready to get started?Download WordPress


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

Function Reference/wp generate auth cookie


Generate authentication cookie contents.

@uses apply_filters() Calls 'auth_cookie' hook on $cookie contents, User ID and expiration of cookie.


(integer) (required) User ID
Default: None
(integer) (required) Cookie expiration in seconds
Default: None
(string) (optional) Optional. The cookie scheme to use: auth, secure_auth, or logged_in
Default: auth

Return Values

Authentication cookie contents

Change Log

Since: 2.5

Source File

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