After changing what does:
Config::get('session.lifetime');
show? And did you also place 10080 in .env.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi guys! I'm having a somewhat big problem right now. Apparently, you can set the session lifetime in config/session.php by changing the lifetime value (which is in minutes) directly or via the SESSION_LIFETIME env variable. By default, it is 120 minutes and I can see that clearly when inspecting by cookies in Chrome. The Expires / Max-Age date time is two hours after my last activity. However, I tried to increase and decrease the lifetime config value (directly and via the .env file), but it always remain 120 minutes when I look at the Expires / Max-Age date time.
Here's the steps I took when changing the lifetime value :
php artisan config:clear
Application panelI also bumped the session.cookie_lifetime and session.gc_maxlifetime as I found in a StackOverflow thread, but it didn't do anything.
Thanks in advance guys!
P.S. Here's my current lifetime config (which doesn't work as intended, it remains 120 minutes)
/*
|--------------------------------------------------------------------------
| Session Lifetime
|--------------------------------------------------------------------------
|
| Here you may specify the number of minutes that you wish the session
| to be allowed to remain idle before it expires. If you want them
| to immediately expire on the browser closing, set that option.
|
*/
// 1 week lifetime
'lifetime' => env('SESSION_LIFETIME', 10080),
'expire_on_close' => false,
Additionnal info : The expire_on_close config works as expected.
After changing what does:
Config::get('session.lifetime');
show? And did you also place 10080 in .env.
Please or to participate in this conversation.