wp_validate_auth_cookie


wp_validate_auth_cookie ( $cookie = '', $scheme = '' )

Parameters:
  • (string) $cookie Optional. If used, will validate contents instead of cookie's
  • (string) $scheme Optional. The cookie scheme to use: auth, secure_auth, or logged_in
Returns:
  • (false|int) False if invalid cookie, User ID if valid.
Defined at:

Description

Validates authentication cookie.

The checks include making sure that the authentication cookie is set and pulling in the contents (if $cookie is not used).

Makes sure the cookie is not expired. Verifies the hash in cookie is what is should be and compares the two.

Related Functions

wp_clear_auth_cookie, wp_parse_auth_cookie, wp_generate_auth_cookie, wp_set_auth_cookie, wp_validate_logged_in_cookie

Top Google Results

User discussions

wpseek mobile