尝试设置$experation
到负整数:
function myplugin_cookie_expiration( $expiration, $user_id, $remember ) {
return $remember ? $expiration : -600;
}
add_filter( \'auth_cookie_expiration\', \'myplugin_cookie_expiration\', 99, 3 );
从Cookie上的w3schools PHP页面:
<?php
// set the expiration date to one hour ago
setcookie("user", "", time()-3600);
?>