How to logout a user when he closes the tab/window ?
If no, it is possible to clear the session after specific time? How to do that?
How to logout a user when he closes the tab/window ?
If no, it is possible to clear the session after specific time? How to do that?
I worked long on this one. It is because of the WordPress remember me. Use this code in your theme's functions.php
and it should fix your issue:
function myplugin_cookie_expiration( $expiration, $user_id, $remember ) {
return $remember ? $expiration : 180;
}
add_filter( 'auth_cookie_expiration', 'myplugin_cookie_expiration', 99, 3 );