ID; } endif; if ( !function_exists('wp_set_auth_cookie') ) : /** * wp_set_auth_cookie() - Sets the authentication cookies based User ID * * The $remember parameter increases the time that the cookie will * be kept. The default the cookie is kept without remembering is * two days. When $remember is set, the cookies will be kept for * 14 days or two weeks. * * @since 2.5 * * @param int $user_id User ID * @param bool $remember Whether to remember the user or not */ function wp_set_auth_cookie($user_id, $remember = false) { if ( $remember ) { $expiration = $expire = time() + 1209600; } else { $expiration = time() + 172800; $expire = 0; } $cookie = wp_generate_auth_cookie($user_id, $expiration); do_action('set_auth_cookie', $cookie, $expire); setcookie(AUTH_COOKIE, $cookie, $expire, COOKIEPATH, COOKIE_DOMAIN); if ( COOKIEPATH != SITECOOKIEPATH ) setcookie(AUTH_COOKIE, $cookie, $expire, SITECOOKIEPATH, COOKIE_DOMAIN); } endif; if ( !function_exists('wp_clear_auth_cookie') ) : /** * wp_clear_auth_cookie() - Deletes all of the cookies associated with authentication * * @since 2.5 */ function wp_clear_auth_cookie() { setcookie(AUTH_COOKIE, ' ', time() - 31536000, COOKIEPATH, COOKIE_DOMAIN); setcookie(AUTH_COOKIE, ' ', time() - 31536000, SITECOOKIEPATH, COOKIE_DOMAIN); // Old cookies setcookie(USER_COOKIE, ' ', time() - 31536000, COOKIEPATH, COOKIE_DOMAIN); setcookie(PASS_COOKIE, ' ', time() - 31536000, COOKIEPATH, COOKIE_DOMAIN); setcookie(USER_COOKIE, ' ', time() - 31536000, SITECOOKIEPATH, COOKIE_DOMAIN); setcookie(PASS_COOKIE, ' ', time() - 31536000, SITECOOKIEPATH, COOKIE_DOMAIN); } endif; ?>