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

floweringmind's avatar

Session Timeout is always 2 hours

I have modified my php.ini to be 30 and my Laravel config/sessions to be 30, which I figured is 1 minute.

Yet every time I log into my site the cookie is set for 2 hours. Is there somewhere else that the session is being set?

0 likes
7 replies
tisuchi's avatar

Normally it stores in 'lifetime' => env('SESSION_LIFETIME', 43200), at config/session.php files.

3 likes
floweringmind's avatar

@TISUCHI - As I said above, I changed that to 'lifetime' => env('SESSION_LIFETIME', 30), and Laravel is still setting my cookies at 2 hours.

3 likes
tisuchi's avatar
tisuchi
Best Answer
Level 70

@FLOWERINGMIND - Can you try setting your lifetime values in .env file? For example, in your .env file, add this values and then restart your server?

SESSION_LIFETIME=30
4 likes

Please or to participate in this conversation.