wp_parse_auth_cookie [ WordPress Function ]
wp_parse_auth_cookie ( $cookie = '', $scheme = '' )
| Parameters: |
|
| Returns: |
|
| Defined at: |
|
Benzer Fonksiyonlar: wp_set_auth_cookie, wp_clear_auth_cookie, wp_generate_auth_cookie, wp_validate_auth_cookie, wp_setcookie
Parse a cookie into its components
Source
<?php
function wp_parse_auth_cookie($cookie = '', $scheme = '') {
if ( empty($cookie) ) {
switch ($scheme){
case 'auth':
$cookie_name = AUTH_COOKIE;
break;
case 'secure_auth':
$cookie_name = SECURE_AUTH_COOKIE;
break;
case "logged_in":
$cookie_name = LOGGED_IN_COOKIE;
break;
default:
if ( is_ssl() ) {
$cookie_name = SECURE_AUTH_COOKIE;
$scheme = 'secure_auth';
} else {
$cookie_name = AUTH_COOKIE;
$scheme = 'auth';
}
}
if ( empty($_COOKIE[$cookie_name]) )
return false;
$cookie = $_COOKIE[$cookie_name];
}
$cookie_elements = explode('|', $cookie);
if ( count($cookie_elements) != 3 )
return false;
list($username, $expiration, $hmac) = $cookie_elements;
return compact('username', 'expiration', 'hmac', 'scheme');
}
?>
Examples [ wp-snippets.com ]
Google Arama Sonuçlarý
- Function Reference/wp parse auth cookie « WordPress Codex
wp_parse_auth_cookie() is located in wp-includes/pluggable.php. Retrieved from "http://codex.wordpress.org/Function_Reference/wp_parse_auth_cookie" ...
codex.wordpress.org - WordPress › Support » is_user_logged_in not working as expected
I've dug into the underlying code of is_user_logged_in() and found that the inner call to wp_parse_auth_cookie() returns false . A var_dump($_COOKIE) reveals ...
wordpress.org - PHPXRef 0.7 : WordPress : /wp-includes/pluggable.php source
$cookie_elements = wp_parse_auth_cookie($cookie, $scheme) ) { 522 do_action('auth_cookie_malformed', $cookie, $scheme); 523 return false; 524 } 525 526 ...
phpxref.ftwr.co.uk - .htaccess and WordPress Admin Bar - WordPress
Sep 2, 2011 ... The vital clue came from monitoring the output of wp_parse_auth_cookie() under various states. Thanks for the ideas, guys! Makes it a lot ...
wordpress.stackexchange.com