show your routes.php?
Why am I losing Session?
Laravel 5.2 Firefox .. same issue on Chrome
'driver' => env('SESSION_DRIVER', 'file'),
'lifetime' => 120,
'expire_on_close' => false,
I have a page where the user logs in and I save Session with a final Session::save(); for good measure, and then display home.blade.php where I have put:
$data = Session::all();
var_dump($data);
Which gives me a reassuring dump of the Session variables and I can use those session vars in my template -- so session is working.
There is also a link on home.blade.php to
Route::get('timesheet', 'Timesheet\TimesheetController@index');
And there, I've put :
use Illuminate\Support\Facades\Session;
class TimesheetController extends Controller{
public function index(){
$data2 = Session::all();
var_dump($data2);
But all it gives me is:
array(0) {
}
How did I lose my session?
Timesheet isn't wrapped in web middleware. Only web middleware maintains state (sets a session)
Please or to participate in this conversation.