Session data I've set disappears after a period of inactivity

I may be doing this the wrong way, or there may be a better way to do it..

Upon login I'm setting some session data:

session(['api_token' => $user->api_token]);
session(['season' => Season::find($request->season)]);
session(['centres' => Centre::where('active', 1)->get()]);

I call it like so...

session('season')->name

.env file:

SESSION_LIFETIME=9999999999

This works great for a while, but if there's a period of a few hours of activity (I haven't timed it exactly), then the session data I've set gets lost, I have to log out then back in to set the session data again.

However, the user still remains logged in, I can pull Auth data perfectly fine.

What is going on here?



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/38fn6ug
via IFTTT

تعليقات

المشاركات الشائعة من هذه المدونة

I am unable to figure out how to create payment collection request, after a form has been submitted in laravel

laravel, mysql transaction not working after failed one time