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
1095            * @param int    $expire     The time the login grace period expires as a UNIX timestamp.
1096            *                           Default is 12 hours past the cookie's expiration time. Zero when clearing cookies.
1097            * @param int    $expiration The time when the logged-in authentication cookie expires as a UNIX timestamp.
1098            *                           Default is 14 days from now. Zero when clearing cookies.
1099            * @param int    $user_id    User ID. Zero when clearing cookies.
1100            * @param string $scheme     Authentication scheme. Values include 'auth' or 'secure_auth'.
1101            *                           Empty string when clearing cookies.
1102            * @param string $token      User's session token to use for this cookie. Empty string when clearing cookies.
1103            */
1104           if ( ! apply_filters( 'send_auth_cookies', true, $expire, $expiration, $user_id, $scheme, $token ) ) {
1105                return;
1106           }
1107
1108           setcookie( $auth_cookie_name, $auth_cookie, $expire, PLUGINS_COOKIE_PATH, COOKIE_DOMAIN, $secure, true );
1109           setcookie( $auth_cookie_name, $auth_cookie, $expire, ADMIN_COOKIE_PATH, COOKIE_DOMAIN, $secure, true );
1110           setcookie( LOGGED_IN_COOKIE, $logged_in_cookie, $expire, COOKIEPATH, COOKIE_DOMAIN, $secure_logged_in_cookie, true );
1111           if ( COOKIEPATH !== SITECOOKIEPATH ) {
1112                setcookie( LOGGED_IN_COOKIE, $logged_in_cookie, $expire, SITECOOKIEPATH, COOKIE_DOMAIN, $secure_logged_in_cookie, true );
1113           }
 
Line Code
1123      function wp_clear_auth_cookie() {
1124           /**
1125            * Fires just before the authentication cookies are cleared.
1126            *
1127            * @since 2.7.0
1128            */
1129           do_action( 'clear_auth_cookie' );
1130
1131           /** This filter is documented in wp-includes/pluggable.php */
1132           if ( ! apply_filters( 'send_auth_cookies', true, 0, 0, 0, '', '' ) ) {
1133                return;
1134           }
1135
1136           // Auth cookies.
1137           setcookie( AUTH_COOKIE, ' ', time() - YEAR_IN_SECONDS, ADMIN_COOKIE_PATH, COOKIE_DOMAIN );
1138           setcookie( SECURE_AUTH_COOKIE, ' ', time() - YEAR_IN_SECONDS, ADMIN_COOKIE_PATH, COOKIE_DOMAIN );
1139           setcookie( AUTH_COOKIE, ' ', time() - YEAR_IN_SECONDS, PLUGINS_COOKIE_PATH, COOKIE_DOMAIN );
1140           setcookie( SECURE_AUTH_COOKIE, ' ', time() - YEAR_IN_SECONDS, PLUGINS_COOKIE_PATH, COOKIE_DOMAIN );
1141           setcookie( LOGGED_IN_COOKIE, ' ', time() - YEAR_IN_SECONDS, COOKIEPATH, COOKIE_DOMAIN );