Welcome Guest, Not a member yet? Register   Sign In
Problem with session and "back" in browser
#7

[eluser]BrianDHall[/eluser]
Um, if you click 'back' are you sure the page is being reloaded and isn't cached? Have you tried sending a no-cache header on pages where a user is logged in?

If you can reload the page, try setting the value of the main variable you check to an empty string

Code:
$this->session->userdata('logged_in') == '';

and then kill the session. Changes to a variable are instant in all session types, whereas destroying the session is not always instantaneous.

I first learned of this problem with the native PHP session library, years ago. It was no surprise to me how the native session library behaved because of that...well, that's not true. I was surprised because I expected the CI implementation to be better in this regard.

However once you know the inherent limitations with sessions you easily adjust to doing things a certain way so it won't effect your programs anymore.

Try this and make sure you aren't just going back to a cached page before you throw everything out and start using native sessions, as I think you'll find that they are just about as big a pain in the ass as any other implementation is.


Messages In This Thread
Problem with session and "back" in browser - by El Forum - 09-08-2009, 11:56 AM
Problem with session and "back" in browser - by El Forum - 09-09-2009, 01:21 AM
Problem with session and "back" in browser - by El Forum - 09-09-2009, 02:26 AM
Problem with session and "back" in browser - by El Forum - 09-09-2009, 02:37 AM
Problem with session and "back" in browser - by El Forum - 09-09-2009, 02:56 AM
Problem with session and "back" in browser - by El Forum - 09-09-2009, 04:08 AM
Problem with session and "back" in browser - by El Forum - 09-09-2009, 08:24 AM
Problem with session and "back" in browser - by El Forum - 06-01-2011, 05:35 AM
Problem with session and "back" in browser - by El Forum - 06-01-2011, 05:47 AM
Problem with session and "back" in browser - by El Forum - 06-01-2011, 08:38 PM
Problem with session and "back" in browser - by El Forum - 06-01-2011, 09:26 PM
Problem with session and "back" in browser - by El Forum - 06-02-2011, 03:43 AM



Theme © iAndrew 2016 - Forum software by © MyBB