A
A
arseniylebedev2018-04-10 17:13:35
Laravel
arseniylebedev, 2018-04-10 17:13:35

Laravel why authorization fails when refreshing a page?

If you refresh the page or just navigate through the pages of the site, then authorization may fail. There is a redirect to the /login route, if the page is updated on this route, then everything will be fine, the user will be authorized again, and this does not always work the first time, sometimes you need to refresh the page 3 times.
Laravel 5.6, standard laravel authorization. Session driver tried file and database still crashes.
Routes for authorized users use the auth and web middleware.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
iljaGolubev, 2018-04-10
@iljaGolubev

Check config/session.php?

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

Check in .env
SESSION_LIFETIME=120

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question