7

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.

  • I have no direct answer, however, please enable debugging in WordPress, to see, if anything is weird with your particular installation! – Pothi Kalimuthu Sep 17 '13 at 5:38
  • @PothiKalimuthu Already done and I can't see anything out of the ordinary. – Twifty Sep 17 '13 at 6:11
3

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 31556926; // 1 year in seconds
}

Or you can also use this plugin to change the time limit: Configure Login Timeout

Hope that helps!!

  • starting with 4.0 (IIRC) wordpress do use session tracking, and cookie expiry is only partial explanation/solution at best – Mark Kaplun Apr 25 '17 at 5:43

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.