lundi 28 décembre 2015

Auth::user is not preserved on redirect

After I updated from laravel 5.1 to 5.2 I got this unexpected problem. I use Auth::login to manually login the user. And when I redirect user is not preserved.

All the config was gracefully ported from from clear laravel 5.2 installation.

Here's the routes code:

Route::get('test', function () {
    $user = \Upping\Models\User::find(311);
    Auth::login($user);
    Auth::check(); // true
    return redirect('authCheck');
});

Route::get('authCheck', function () {
    Auth::check(); // false
});

Speaking of laravel experience, tiny hint should be enough for me. And thanks for helping out.



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/1YNldZr
via IFTTT

Aucun commentaire:

Enregistrer un commentaire