Welcome Guest, Not a member yet? Register   Sign In
Differentiating between an expired session or non-existant session
#1

[eluser]stevefink[/eluser]
Hi folks,

I'm digging into Code Igniter's Session class to understand it better. The fine development team over at EllisLabs is using a custom session class, versus native PHP sessions. They work great so far!

My one question is the following -- is there a way to differentiate between an expired session and one that just doesn't exist? The reason for this question is that I'd like to provide a user with a message on our login form if they were redirected there because of an expired session. If they do not have a session at all, I'll omit the message.

Thanks for the heads up, I'll continue digging into the source and experimenting!

/sf
#2

[eluser]Seppo[/eluser]
I don't think you can, inside the session library scope... The session expires when the cookie expires, and if the cookie has expired then you have no way to recognize the user was logged in.

However, you can set a cookie when the user login, besides de session cookie, flaging the user that once was logged in, and with no expiration, so when a user open the redirect page, you can check that other cookie.
#3

[eluser]stevefink[/eluser]
Thanks Seppo. I guess I'll figure out another way of handling the situation. BTW, just noticed the titles Lab Assistant and Research Assistant, I wonder if these are new to fit in with the EllisLabs theme. :-P
#4

[eluser]Seppo[/eluser]
Yeah, that's correct... it's discussed here =)




Theme © iAndrew 2016 - Forum software by © MyBB