Go Back   Computer Forums > Web Design | Website Development > Web Programming
Click Here to Login
Join Computer forums Today


Reply
 
Thread Tools Search this Thread Display Modes
 
Old 07-05-2014, 09:10 AM   #1
Solid State Member
 
Join Date: May 2014
Location: United States
Posts: 16
Default How to prevent sessions from being saved

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?
__________________

evansste is offline   Reply With Quote
Old 07-07-2016, 07:14 PM   #2
Beta Member
 
Join Date: Jul 2016
Location: Taiwan
Posts: 1
Default Re: How to prevent sessions from being saved

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.
__________________

terrymorgan is offline   Reply With Quote
Old 07-08-2016, 10:05 AM   #3
Fully Optimized
 
joedaman633's Avatar
 
Join Date: Apr 2012
Location: England, Birmingham
Posts: 1,785
Default Re: How to prevent sessions from being saved

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
__________________
Athlon II x4 645 || 1TB 7200rpm HDD || EVGA GTX 650Ti OC || 8GB DDR3 RAM || Windows 7 Home x64

i5 4210M || 500GB Samsung EVO 850 SSD || GeForce 825M || 16GB DDR3 RAM || Windows 10 x64
joedaman633 is offline   Reply With Quote
Old 07-28-2016, 06:13 AM   #4
Beta Member
 
Join Date: Jul 2016
Location: UK
Posts: 1
Default Re: How to prevent sessions from being saved

php Session variables are cleared using the session_unset command see
PHP: session_unset - Manual
shepherd is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



All times are GMT -5. The time now is 06:17 PM.


Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0