Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: send_auth_cookies

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

This hook occurs 2 times in this file.

Line Code
1076            * @param int    $expire     The time the login grace period expires as a UNIX timestamp.
1077            *                           Default is 12 hours past the cookie's expiration time. Zero when clearing cookies.
1078            * @param int    $expiration The time when the logged-in authentication cookie expires as a UNIX timestamp.
1079            *                           Default is 14 days from now. Zero when clearing cookies.
1080            * @param int    $user_id    User ID. Zero when clearing cookies.
1081            * @param string $scheme     Authentication scheme. Values include 'auth' or 'secure_auth'.
1082            *                           Empty string when clearing cookies.
1083            * @param string $token      User's session token to use for this cookie. Empty string when clearing cookies.
1084            */
1085           if ( ! apply_filters( 'send_auth_cookies', true, $expire, $expiration, $user_id, $scheme, $token ) ) {
1086                return;
1087           }
1088
1089           setcookie( $auth_cookie_name, $auth_cookie, $expire, PLUGINS_COOKIE_PATH, COOKIE_DOMAIN, $secure, true );
1090           setcookie( $auth_cookie_name, $auth_cookie, $expire, ADMIN_COOKIE_PATH, COOKIE_DOMAIN, $secure, true );
1091           setcookie( LOGGED_IN_COOKIE, $logged_in_cookie, $expire, COOKIEPATH, COOKIE_DOMAIN, $secure_logged_in_cookie, true );
1092           if ( COOKIEPATH != SITECOOKIEPATH ) {
1093                setcookie( LOGGED_IN_COOKIE, $logged_in_cookie, $expire, SITECOOKIEPATH, COOKIE_DOMAIN, $secure_logged_in_cookie, true );
1094           }
 
Line Code
1104      function wp_clear_auth_cookie() {
1105           /**
1106            * Fires just before the authentication cookies are cleared.
1107            *
1108            * @since 2.7.0
1109            */
1110           do_action( 'clear_auth_cookie' );
1111
1112           /** This filter is documented in wp-includes/pluggable.php */
1113           if ( ! apply_filters( 'send_auth_cookies', true, 0, 0, 0, '', '' ) ) {
1114                return;
1115           }
1116
1117           // Auth cookies.
1118           setcookie( AUTH_COOKIE, ' ', time() - YEAR_IN_SECONDS, ADMIN_COOKIE_PATH, COOKIE_DOMAIN );
1119           setcookie( SECURE_AUTH_COOKIE, ' ', time() - YEAR_IN_SECONDS, ADMIN_COOKIE_PATH, COOKIE_DOMAIN );
1120           setcookie( AUTH_COOKIE, ' ', time() - YEAR_IN_SECONDS, PLUGINS_COOKIE_PATH, COOKIE_DOMAIN );
1121           setcookie( SECURE_AUTH_COOKIE, ' ', time() - YEAR_IN_SECONDS, PLUGINS_COOKIE_PATH, COOKIE_DOMAIN );
1122           setcookie( LOGGED_IN_COOKIE, ' ', time() - YEAR_IN_SECONDS, COOKIEPATH, COOKIE_DOMAIN );