Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel 4: how to remember a user when logging him in using Auth::login

My users can login using social options (Facebook, Twitter) and so I don't use the Auth::attempt() method, but the Auth::login().

How can I remember my users so the don't have to login every time they restart the browser?

like image 957
duality_ Avatar asked Feb 18 '23 10:02

duality_


1 Answers

It is not in the docs, but if you look at the code;

public function login(UserInterface $user, $remember = false)

So just do

Auth::login($user, true);
like image 198
Laurence Avatar answered Feb 26 '23 21:02

Laurence