Welcome Guest, Not a member yet? Register   Sign In
Stay logged in, or not !
#1

[eluser]dorwin[/eluser]
Hello,

I am developping a website with member page, so there is authentification, etc.. Session variables are managed by Ci_session, so sessions are reloaded even I leave navigator.

I would like to put a checkbox with option : "Stay logged in", or not ! If not, session must be destroy when I leave nav but I don't really know how to do that, cause Ci_session are too automatically managed...

I don't know if I'm clear ><,

thanks !
#2

[eluser]rogierb[/eluser]
The first question that pops in my mind is: How do you know someone has left?
That, to me, seems like the million dollar question.

Most session systems are based on time. When someone hasn't been active for a specific period of time, the session is destroyed. When a user logges off, their session is destroyed. This means some form of user interaction to signal the user is leaving.

You want to destroy the session when someone leaves. If you answer my first question, you will have found your answer.
#3

[eluser]dorwin[/eluser]
thanks for the answer and,yes of course I cant't really know that but before CI, it was something like that :
If I want to stay logged, cookie are created. on each page, if session dont't exist, check if cookie exist, if yes, session created, or not.

But here, session are mixed with cookies, so I'm little lost ! Currently session are highlander, so I can't test if session exist (first come to a page of the website), cause Ci_session will automatically load it and load eavery variable !
#4

[eluser]rogierb[/eluser]
Ah, I see. That is not very secure (cookie stealing). But if you want something like that, you could create a second cookie.




Theme © iAndrew 2016 - Forum software by © MyBB