Hi, is it possible to make the Laravel session lifetime dynamic? I want the user to be able to choose how long they can be inactive for until they are automatically logged out.
It seems I can only enter a static value for 'lifetime' in config/session.php.
So I coded the functionality in the frontend, then realized it only logged the user out if they had the app open in the browser when the time was up. :)
Could anyone please give me direction on how to do it please?
I am looking for a way to override the session timeout (which I can now do using your hint). Yii has a method onBeginRequest where I used to override session timeout, what is the best place to use Config::set('sessions.lifetime', $someValue); in Laravel 5.6?
I am a Laravel newbie so if you could go into a bit of detail, it'd be really helpful. Thanks.
I think I managed to do that myself. I needed to override session.lifetime and some other config before every web request.
I wrote a middleware, LoadConfig, added it to app/Http/Kernel in the web middleware group and voila, all my requests have the updated config without doing any extra work.