@johnnemo when you close the browser you also loose the "remember me" in session user?
Sep 20, 2015
7
Level 8
Session key destroyed (L5.1)
Hello,
I try to keep a key in my session for a specific user when he logs in. I store the current login timestamp as follows
if($attempt){
$request->session()->put('login', Carbon::now()->toDateTimeString());
}
and pass it to the session. This works just fine. I also use the remember me approach (with the appropriate remember_me token). The problem is when I close the browser the login-token is being destroyed. Is there any way to keep this value..? Or should I go to another session driver (e.g database) ..?
Level 88
You need to create the cookie and pass that
$cookie = cookie('name', 'value', $minutes)
return response()->view('some.view')->withCookie($cookie);
You can delete the cookie on request as well
$cookie = Cookie::forget('name');
return redirect()->route('home')->withCookie($cookie);
1 like
Please or to participate in this conversation.