How to disable "Session Expired in Laravel " in my Login Page? How to disable "Session Expired in Laravel " in my Login Page? laravel laravel

How to disable "Session Expired in Laravel " in my Login Page?


There's no "forever" option but you can set it for 20 years or so...

it can be found in

config/session.php

just change 'lifetime' => 120, to 'lifetime' => 20 * (60 * 24 * 365), for 20 years


You can't disable or There's no "forever" option but you can set it for 20 years or so

You can only set it in minutes, but it's just a basic PHP array, if you really wanted to then you could just do the basic math in it if you wanted a longer time.

Like to get an hour, multiply it by 60, to get a day multiply the hours by 24, and to get a year multiply the days by 365.

'lifetime' => 1 * (60 * 24 * 365), // 1 year

But realistically there's no point and you won't be changing this again so it'd be fine to just put the final result in the config file and leave a comment next to it to note how much the number of minutes equates to.


I dont think you can make a sessions last forever because they are meant to be expired. If your project requires a longer session lifetime, you can refer to this StackOverflow Post: