Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

lalitesh's avatar

Idle session expiration

There is a configuration in Laravel to set the session drive and idle expiration time, that I set to the following:


    'lifetime' => 1,

    'expire_on_close' => true,

Now, I logged into my Laravel application and left the screen idle for more than 1 minute ( actually 7 minutes ) and then refreshed the page, but I am not logged out.

I also re-started the browser but I am still in.

Do I need to code anywhere else for auto-logout?

0 likes
3 replies
bobbybouwmann's avatar

The session will expire when you close the browser. So if you login, close the tab, wait two minutes and then you need to login again!

Laravel 5.2 will have extra functionality to handle these cases

Please or to participate in this conversation.