2

Can't really find a clear answer on how to keep WordPress login sessions alive when users close their browser.

I found a clear general explanation about why this happens from reko_t, but anything (which is not much) I find about this specific to WordPress only states why WordPress sessions with (such?) expirations might cause issues.

Could I just set session.cookie_lifetime and session.gc_maxlifetime in php.ini, can I use a filter (like auth_cookie_expiration) to have WordPress set these values when starting the session or is there another way to accomplish this without causing issues?

Johnny
  • 125
  • 1
  • 9
  • 1
    You can change the expiration time of the cookie with auth_cookie_expiration https://premium.wpmudev.org/blog/how-to-extend-the-auto-logout-period-in-wordpress/ – Andrew Schultz Mar 26 '18 at 13:56
  • @AndrewSchultz Sorry for the dumb question then. I had not tested the browser close behavior with the Remember me option. I knew it extends the expiration to 14 days (which is enough), but figured browser close would have the same effect with or without this option. – Johnny Mar 26 '18 at 14:29
  • And ... thank you for your response ;-) – Johnny Mar 26 '18 at 14:30

0 Answers0