Question

I am working on creating website with Yii framework and I have a problem that I don't know how to solve. My problem is that I am always logged in my website even when I have NOT checked "remember me" checkbox. for example yesterday I logged in my website and didn't press logout, I just shutdown my pc and today I found out that when I entered my website I was allready loged in. so can you tell me why Yii is doing this? I just want that Yii ONLY saved my status when I will press "remember me".

can you help me, please?

Was it helpful?

Solution

You did not mention if you went to the website by restoring the previous sessions of the browser or using a new session. As most of the modern browsers are smart enough to save an image of the last session before unusual termination of the browser window (you mentioned shutting down the computer), hence you get most of your previous sessions of logged in application when you reopen the application. This will happen unless you do a check in your application of the session, that exist. And maintain a piece of code to validate the user session with the time of visit and act accordingly.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top