0

I'm facing issue with the Remember Me built-in feature in Laravel: it just doesn't work anymore. Actually, it does work for some time, but doesn't last more than a few hours…

The only thing I can see that changed since it doesn't work anymore is the add of Socialite, which allows the use of social network to register and log into a website.

I obviously didn't changed the code inside the core of Laravel or Socialite vendor.

I didn't change the settings, neither in code nor in PHP config

Also, I checked the code I was using since then (which didn't change either) and it seems to be correct with Auth::login($user, true) as explained in the documentation (second parameter says "remember that user")

Any idea what could have been wrong? Could it be a recent update on Laravel (I read that on a forum, but nowhere else)?

Pierre Le Bot
  • 294
  • 1
  • 5
  • 20
  • It could be cached related, did you clean your cache a few hours ago? – utdev Apr 23 '18 at 21:48
  • @utdev, nope! And this issue is happening since a few months now, not just in the last hours :-/ – Pierre Le Bot Apr 23 '18 at 22:09
  • Just check if there is remember_token in your browser's cookie or not – aj3sh Apr 24 '18 at 02:30
  • @AjeshSenThapa, it is here, yes. But I noticed in my commit that I've changed the **SESSION_DOMAIN** value in `session.php` file ; it may have an impact, or not, but I'm trying with this solution and will let you know. If you have another idea, let me know – Pierre Le Bot Apr 24 '18 at 08:28
  • @aj3sh, I rolled back **SESSION_DOMAIN** to *null* and tried again. It seems better (like I'm logged in for a few hours) but the day after I have to log in again… any idea? – Pierre Le Bot Apr 26 '18 at 08:45
  • What server are you using ? Sometimes it might be also a problem of a server. Check if your laravel will retrieve session and cookies or not. Just do it in your controller or you can log it. Also check the cookie domain and path in your browser. – aj3sh Apr 26 '18 at 10:29

0 Answers0