0

I've creating a working user/login system with the laravel 4 framework and all is working well.

However I'm always logged into the site unless I run the logout process. I would assume that if I login, close all browser windows and open the browser again I would be logged out. This is not the case.

In my Auth::attempt I am setting the $remember parameter to false even though it is false by default.

I have no idea why this is happening. If I logout, close all my browser windows then open them again I am NOT logged in. So this works fine. But if I'm logged in, close all my browsers then open the browser again I am already logged in. Even thought I have specified remember to be false.

What is keeping me logged in? Why does it always remember my login? I cannot find any information on this.

Shane
  • 2,375
  • 4
  • 22
  • 31

3 Answers3

6

Change

'expire_on_close' => false,

to

'expire_on_close' => true,

in /app/config/session.php.

Laravel isn't actually remembering you (you're not being authenticated again by your remember_token), problem is that you session cookie persists on browser close (since it hasn't expired) and Laravel sees you as a logged in user.

Ben
  • 16,275
  • 9
  • 45
  • 63
0

I believe some browsers do this for you, not sure. Did you clear your browsing data / cookies after setting $remember to false and testing?

Nick
  • 461
  • 2
  • 6
  • 16
  • This is not normally an issues. I have tried in on multiple browsers. My browsers are not set up for any kind of auto login and I cannot control how other users use their browsers. Clearing the cache did not help. Same issue. – Shane Aug 07 '14 at 13:53
  • Hmmmmm, are you working within a framework that does things in the background? Or just plain php? – Nick Aug 07 '14 at 13:55
  • Sorry for the late reaction! I'll have to look around aswell since I'm not familiar with Laravel – Nick Aug 10 '14 at 17:37
0

What version you're on?

If below 4.1.26 than your answer is:

 http://laravel.com/docs/upgrade#upgrade-4.1.26

Hope it will help!!! :G

user3657823
  • 291
  • 2
  • 4