I have created 2 different login forms for admin and users in admin login form i have used attempt function i want to use remember me functionality but when i log in to the system without clicking remember me checkbox i can see in database it stores some value is it normal that its storing values not checking remember me token ? this is my code for admin login
if (Auth::guard('admin')->attempt(['email' => $request->email, 'password' => $request->password], $request->remember)) {
// if successful, then redirect to their intended location
return redirect()->intended(route('admin.dashboard'));
}
can someone please help me with remember me functionality in laravel
Try passing boolean value as second parameter to method attempt , or
if (Auth::viaRemember()) {
//
}
use viaRemember
in new laravel versions
also , check your config/session.php setting
'lifetime' => 10080,
'expire_on_close' => true,
just set your expire_on_close
to true
and Auth with Auth::viaRemember()
hope this is helpful
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With