Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




wp_generate_auth_cookie [ WordPress Function ]

wp_generate_auth_cookie ( $user_id, $expiration, $scheme = 'auth' )
Parameters:
  • (int) $user_id User ID
  • (int) $expiration Cookie expiration in seconds
  • (string) $scheme Optional. The cookie scheme to use: auth, secure_auth, or logged_in
Uses:
Returns:
  • (string) Authentication cookie contents
Defined at:



Generate authentication cookie contents.

Source


<?php
function wp_generate_auth_cookie($user_id$expiration$scheme 'auth') {
    
$user get_userdata($user_id);

    
$pass_frag substr($user->user_pass84);

    
$key wp_hash($user->user_login $pass_frag '|' $expiration$scheme);
    
$hash hash_hmac('md5'$user->user_login '|' $expiration$key);

    
$cookie $user->user_login '|' $expiration '|' $hash;

    return 
apply_filters('auth_cookie'$cookie$user_id$expiration$scheme);
}
?>

Examples [ wp-snippets.com ]

Top Google zoekresultaten

Meer ...

Gebruikersdiscussies [ wordpress.org ]

0 User Note(s)

Nog geen één. Wees de eerste!

Nieuw toevoegen ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics