Laravel 5.2 login session not persisting

后端 未结 1 691
礼貌的吻别
礼貌的吻别 2021-01-04 13:51

I have been implementing a simple authentication system on Laravel 5.2 using Sentinel.

// Route : /login
$success = Sentinel::authenticate(array(
   \'email         


        
相关标签:
1条回答
  • 2021-01-04 14:30

    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

    0 讨论(0)
提交回复
热议问题