Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: set_auth_cookie

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
635           $scheme = 'secure_auth';
636      } else {
637           $auth_cookie_name = AUTH_COOKIE;
638           $scheme = 'auth';
639      }
640
641      $auth_cookie = wp_generate_auth_cookie($user_id, $expiration, $scheme);
642      $logged_in_cookie = wp_generate_auth_cookie($user_id, $expiration, 'logged_in');
643
644      do_action('set_auth_cookie', $auth_cookie, $expire, $expiration, $user_id, $scheme);
645      do_action('set_logged_in_cookie', $logged_in_cookie, $expire, $expiration, $user_id, 'logged_in');
646
647      // Set httponly if the php version is >= 5.2.0
648      if ( version_compare(phpversion(), '5.2.0', 'ge') ) {
649           setcookie($auth_cookie_name, $auth_cookie, $expire, PLUGINS_COOKIE_PATH, COOKIE_DOMAIN, $secure, true);
650           setcookie($auth_cookie_name, $auth_cookie, $expire, ADMIN_COOKIE_PATH, COOKIE_DOMAIN, $secure, true);
651           setcookie(LOGGED_IN_COOKIE, $logged_in_cookie, $expire, COOKIEPATH, COOKIE_DOMAIN, false, true);
652           if ( COOKIEPATH != SITECOOKIEPATH )
653                setcookie(LOGGED_IN_COOKIE, $logged_in_cookie, $expire, SITECOOKIEPATH, COOKIE_DOMAIN, false, true);