I hope you will help me in an issue seems to be common and not with a clear and simple solution. Here my case.
I have Laravel project where users authenticate in their own pages. Here, there are some bootstrap modal with forms and CSRF token which expires by default after 2 hours. The issue is that the user doesn't refresh the blade for 2 hours, if he tries to open the modal he gets error. This is due to the CSRF token getting expired and not renewed, unless user does not refresh the page.
Solutions are (the exception handler would be a plus, but not important): 1. extend the expiration time 2. refresh every hour using ajax
I would like to apply the first, as I have seen in other portals done.
Here my configuration:
File config/session.php
'lifetime' => env('SESSION_LIFETIME'),
'expire_on_close' => true,
File ENV
SESSION_LIFETIME = 1200
Session expiration is changed according to the above values, but CSRF token is stuck on 2 hours.
I hope you will help me finding the best solution! Thanks :)