As i know, WordPress makes login session cookie expire in 48 hours or on browser close. And in 14 days, if we check the "Remember Me".

I want to change this time to 5 seconds:

function change_wp_cookie_logout( $expirein ) {
return 5; // 5 seconds
add_filter( 'auth_cookie_expiration', 'change_wp_cookie_logout' );

But when i close admin panel tab, or even browser, and open site/wp-admin, i still get into the WP dashboard. What i'm doing wrong?

Thank you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.