0

I'm trying to change the auth_cookie_expiration setting in my functions.php file in order to limit all logins to 2 hours.

I've done the basic hook for this:

function expire_in_120_minutes()
{
    return 7200;
}

add_filter('auth_cookie_expiration', 'expire_in_120_minutes', 10, 3);

And it seems to be working, but I'd like a way to verify without leaving a login session open for 2 hours. I've tried inspecting the Cookies in the Developer Tools in both Chrome and FF but FF reports "Session" for the wordpress_logged_in cookie and Chrome shows a date of 1969.

So, if this is a Session cookie, it would expire when the browser closes, so how does WP expire it after the set time? Also, is there a way to check that Session expiration using a browser tool?

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.