Not sure if this is a bug or by design, but it’s damn annoying. Every so often, more so after updating the core, while in the admin section, I get booted out with the infamous “Your session has expired” message. Strange in itself since apparently WP doesn’t use sessions. The login prompt comes with a “remember me” checkbox, why isn’t it remembering? I guess there’s a distinction between “remember me” and “keep me logged in” here. I’ve disabled all plugins, deletes cookies, tried other browsers and even yelled at my screen, but I keep getting booted out.
Does WP set a no activity time limit in the admin section? Could somebody explain what exactly WP is doing to keep users logged in.
By default, WordPress makes your login session cookie expire in 48 hours (or on browser close), or 14 days if you check the “Remember Me” box.
Maybe you have some plugins which force your login cookie to expire.
You could manually add the code below on your functions.php
to extend your cookie expiry to whatever timeframe you like. You can, in essence, stop WordPress from ever logging you out by changing the number of seconds to be a much higher number.
add_filter( 'auth_cookie_expiration', 'keep_me_logged_in_for_1_year' );
function keep_me_logged_in_for_1_year( $expirein ) {
return YEAR_IN_SECONDS; // 1 year in seconds
}
Or you can also use this plugin to change the time limit: Configure Login Timeout
Hope that helps!!