Laravel 5 remember I am not working

I can't get Laravel

rememeber me .

I have added token columns to the models table User

. My User

Model Authenticatable

. The user model doesn't contain anything specific to remember me.

I am using the default Auth drivers and secure.

Mine Usercontroller

is different from the standard one. It extends from Controller

. He doesn't use any signs. In my login method, I am using a Auth::login($userModelObject, true)

user to login. Everything works fine. Remember the token is updated in the database. I see 3 cookies in your browser XSRF-TOKEN

, laravel_session

, remember_web_59ba36addc2b2f9401580f014c7f58ea4e30989d

.

Auth::check()

returns true as expected, but if I either delete, expire, or modify laravel_session

, in a subsequent request, the remember_web_59ba36addc2b2f9401580f014c7f58ea4e30989d

cookie is also deleted for some reason (I cannot view it using var_dump($_COOKIE)

only the middleware that I have applied), and I think why the Laravel Auth driver can't use, remember that Cookie for user is autologous. The CSRF middleware is also automatically applied by the Framework.

What could be the reason for this behavior? Do I need to use some additional traits in my user model or controller?

Note. I am using Laravel 5.4 and my session config:

'driver' => env('SESSION_DRIVER', 'file'),
'lifetime' => 20,
'expire_on_close' => false,
'encrypt' => false,
'files' => storage_path('framework/sessions'),
'connection' => null,
'table' => 'sessions',
'store' => null,
'lottery' => [2, 100],
'cookie' => 'laravel_session',
'path' => '/',
'domain' => env('SESSION_DOMAIN', null),
'secure' => env('SESSION_SECURE_COOKIE', false),
'http_only' => true

      

+3


source to share





All Articles