• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Stay logged in, or not !


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 !

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.

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 !

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

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.