Yash
Yash

Reputation: 11

How to make the session timeout infinite in laravel 5.6?

I am trying to set unlimited timeout for the session in laravel. I tried by increasing the time in php.ini and .env for session.

But I'm getting a 419 Error.

How can I make the session persist forever in laravel?

Upvotes: 1

Views: 3034

Answers (1)

farooq
farooq

Reputation: 1673

Try changing the

config/session.php

change the following line

lifetime' => env('SESSION_LIFETIME', 120),
'expire_on_close' => true,

into

lifetime' => env('SESSION_LIFETIME', 1800000),
'expire_on_close' => false,

Then try clearing config and cache using the command :

php artisan config:cache

Upvotes: 2

Related Questions