How to prevent sessions from being saved

evansste

Solid State Member
Messages
16
Location
United States
I'm building a website that uses session variables. My understanding of session variables is that they only exist as long as the browser is open -- meaning that once the browser closes, the session variables are lost.

My website anticipates this to be the case, but I have found that my session variables are being stored (possibly in cookies). When I close the browser, and then reopen it and return to my website, I find that the session variables are still set. Shouldn't they be disappearing when the browser closes?

This is a big problem since my website assumes that the information is lost. Is there some way for me to make sure that my session variables aren't being saved in cookies? That way, when the browser closes, no information has been saved, and therefore, when I return to the website, there should be no session variables. Is there any way to do this? If so, how?
 
Are you using Asp.net? You should check the sessionState element in the web.config and check the
mode="[Off|InProc|StateServer|SQLServer|Custom]"

InProc should be browser state.
 
Session variables are essentially stored in temporary files server side as far as I'm aware and really cookies don't come into it.

Judging by your previous posts, this is PHP. Assuming that:
You're starting each page with session_start();
You're using $_SESSION to access files.

You may need to ensure you're closing every single tab/instance of the browser you have open in order for the session to be closed.

You might also want to check out your php.ini configuration file as it's possible that your session IS being stored in cookies, in which case you need to set the value of your "cookie-lifetime" to 0.
PHP: Runtime Configuration - Manual
 
Back
Top Bottom