I want to extend the login session so that I never ever get logged out. Even if Remember me is left unchecked.

This is the code I have at the moment, but it doesn't seem to work with Remember me unchecked:

function extend_login_cookie_expiration( $expiration, $user_id, $remember ) {
    if ( !is_super_admin() ) {
        $expiration = 946708560;
    return $expiration;
add_filter( 'auth_cookie_expiration', 'extend_login_cookie_expiration', 10, 3 );

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.