laravel5 session跳转页面时就丢失,获取不到
这个是我的session设置
'driver' => env('SESSION_DRIVER', 'file'),
'lifetime' => 999999999,
'expire_on_close' => false,
'encrypt' => false,
'files' => storage_path().'/framework/sessions',
'connection' => null,
'table' => 'sessions',
'lottery' => [2, 100],
'cookie' => 'laravel_session',
'path' => '/',
'domain' => null,
'secure' => false,
我在controller的代码
var_dump(Session::all());
if(Session::has('userInfo')){
var_dump(Session::all());
}else{
Session::put('userInfo','1');
Session::save();
}
只有_token的值,而且一直变
'driver' => env('SESSION_DRIVER', 'file'),
'lifetime' => 999999999,
'expire_on_close' => false,
'encrypt' => false,
'files' => storage_path().'/framework/sessions',
'connection' => null,
'table' => 'sessions',
'lottery' => [2, 100],
'cookie' => 'laravel_session',
'path' => '/',
'domain' => null,
'secure' => false,
我在controller的代码
var_dump(Session::all());
if(Session::has('userInfo')){
var_dump(Session::all());
}else{
Session::put('userInfo','1');
Session::save();
}
只有_token的值,而且一直变
0 个回复