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
1176            * @param int    $expire     The time the login grace period expires as a UNIX timestamp.
1177            *                           Default is 12 hours past the cookie's expiration time. Zero when clearing cookies.
1178            * @param int    $expiration The time when the logged-in authentication cookie expires as a UNIX timestamp.
1179            *                           Default is 14 days from now. Zero when clearing cookies.
1180            * @param int    $user_id    User ID. Zero when clearing cookies.
1181            * @param string $scheme     Authentication scheme. Values include 'auth' or 'secure_auth'.
1182            *                           Empty string when clearing cookies.
1183            * @param string $token      User's session token to use for this cookie. Empty string when clearing cookies.
1184            */
1185           if ( ! apply_filters( 'send_auth_cookies', true, $expire, $expiration, $user_id, $scheme, $token ) ) {
1186                return;
1187           }
1188
1189           setcookie( $auth_cookie_name, $auth_cookie, $expire, PLUGINS_COOKIE_PATH, COOKIE_DOMAIN, $secure, true );
1190           setcookie( $auth_cookie_name, $auth_cookie, $expire, ADMIN_COOKIE_PATH, COOKIE_DOMAIN, $secure, true );
1191           setcookie( LOGGED_IN_COOKIE, $logged_in_cookie, $expire, COOKIEPATH, COOKIE_DOMAIN, $secure_logged_in_cookie, true );
1192           if ( COOKIEPATH !== SITECOOKIEPATH ) {
1193                setcookie( LOGGED_IN_COOKIE, $logged_in_cookie, $expire, SITECOOKIEPATH, COOKIE_DOMAIN, $secure_logged_in_cookie, true );
1194           }
 
Line Code
1204      function wp_clear_auth_cookie() {
1205           /**
1206            * Fires just before the authentication cookies are cleared.
1207            *
1208            * @since 2.7.0
1209            */
1210           do_action( 'clear_auth_cookie' );
1211
1212           /** This filter is documented in wp-includes/pluggable.php */
1213           if ( ! apply_filters( 'send_auth_cookies', true, 0, 0, 0, '', '' ) ) {
1214                return;
1215           }
1216
1217           // Auth cookies.
1218           setcookie( AUTH_COOKIE, ' ', time() - YEAR_IN_SECONDS, ADMIN_COOKIE_PATH, COOKIE_DOMAIN );
1219           setcookie( SECURE_AUTH_COOKIE, ' ', time() - YEAR_IN_SECONDS, ADMIN_COOKIE_PATH, COOKIE_DOMAIN );
1220           setcookie( AUTH_COOKIE, ' ', time() - YEAR_IN_SECONDS, PLUGINS_COOKIE_PATH, COOKIE_DOMAIN );
1221           setcookie( SECURE_AUTH_COOKIE, ' ', time() - YEAR_IN_SECONDS, PLUGINS_COOKIE_PATH, COOKIE_DOMAIN );
1222           setcookie( LOGGED_IN_COOKIE, ' ', time() - YEAR_IN_SECONDS, COOKIEPATH, COOKIE_DOMAIN );