Oct 9, 2017
0
Level 1
session store login variables
I've made a custom login using laravel 5.5. After a successful login, method authenticated() is called which I added to LoginController. In authenticated() I try to store extra login request variables in the session using session(['foo' => 'bar']);
However these added session variables are immediately lost after the redirection (in LoginController I use the default $redirectTo = '/home';)
What should I do in order to keep the variables in the session? I have read in other places folowing solutions, which don't work in L5.5
- use
$request->session()->save() - change the cookie name in session.php to a fixed name like
'cookie' => "mysession"
I use file session driver.
Please or to participate in this conversation.