Session not storing if following 5.3 documentation? In the Laravel 5.3 documentation for sessions - https://laravel.com/docs/5.3/session - it says you can store data in the session by using...
$request->session()->put('keys', $request->all());
...however after changing pages and calling...
$request->session()->get('keys');
it is empty.
It all works properly if I call ->save() after the put. So what I'm wondering is, is ->save() something that always needs called when modifying the session, and if so.. why in the world is it not mentioned anywhere in the documentation?
Was pulling my hair out for a while over this.
Okay actually calling ->save() doesn't seem to be saving it either.
On one page I have..
$request->session()->put('filters', $request->all());
$request->session()->save();
dd($request->session()->get('filters'));
which always dumps the filters that I just had in $request->all();
but when I go to another page and call
dd($request->session()->get('filters'));
I either get something old/different or null.
Oh, calling dd() after save() prevents the save().
Nevermind, it's still not saving everything every time. Ugh
Please sign in or create an account to participate in this conversation.