Hi everybody
I want to logout my user after one hour.I use session for that .
I set lifetime='60'
but it doesn't work , by the way I don't want to use it. is there any other way?
when user login :
$now=new DateTime();
Session::put('time',$now);
so how can I check the time is next 1 hour? I used the lifetime set it to 60. but didn't destroyed after that .I checked with this code:
if(Session::has('time'))
{ echo 'something'; }
is there other way? or what's my wrong? thanks everybody
Well, if I understand correctly, you're going to need to compare times. So when a user logs in, set a session with the time they logged in. And then inside of a Route filter or somewhere, you can check to see if that time exceeds an hour.
Read over the first answer to this stackoverflow question
Good luck.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community