Laravel 5.2 login session not persisting

最后都变了- 提交于 2019-11-30 18:42:26

In Laravel 5.2 you need to apply web group middlewere to all your routes you wan't to make sessions work. This is the major change from Laravel 5.1.

Please look at https://laravel.com/docs/5.2/routing#basic-routing

The default routes.php file looks like this at the moment:

Route::group(['middleware' => ['web']], function () {
    // here you should put your routes
});

EDIT

You can look also directly at https://github.com/laravel/laravel/blob/master/app/Http/Kernel.php into middlewareGroups property to know which middlewares are fired for web group middleware

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!