473,587 Members | 2,487 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Session cookie? Browser instance cookie?

Ben
Hi, I'm sending out a session cookie. That is a cookie that has no
expiration date. When I surf through the site, no problems, but if I close
the browser and open it back up, the cookie is still there if other browser
windows were open. Even if those windows didn't go to the site with the
cookie or spawn from the browser that is visiting the site. This is causing
a problem. People want to be able to close the browser to logout.

How can I achive this in asp.net? Basically if they close the browser that
was at the site, I want that cookie gone. The cookie persisting across
browsers that haven't touched the site seems odd...

If I close all open browsers, the cookie is finally destroied.

TIA,
Ben

Nov 18 '05 #1
3 2238
"Ben" <be*@online.nos pam> wrote in message
news:uG******** *********@fe37. usenetserver.co m...
Hi, I'm sending out a session cookie. That is a cookie that has no
expiration date. When I surf through the site, no problems, but if I close the browser and open it back up, the cookie is still there if other browser windows were open. Even if those windows didn't go to the site with the
cookie or spawn from the browser that is visiting the site. This is causing a problem. People want to be able to close the browser to logout.

How can I achive this in asp.net? Basically if they close the browser that was at the site, I want that cookie gone. The cookie persisting across
browsers that haven't touched the site seems odd...


Sorry, this isn't an ASP.NET issue, it's a browser issue. In the case of IE,
if you launch one copy of IE, then use it to create several other windows
(using Ctrl-N, for instance), then they are all running in the same process,
and they share cookies. If you launch a separate process, it will not share
the cookies of the first one. This may work differently with different
browsers, but I'd expect many if not most to share cookies.

You might consider using hidden form fields instead of cookies.
--
John Saunders
johnwsaundersii i at hotmail
Nov 18 '05 #2
Ben
"John Saunders" <jo************ **@notcoldmail. com> wrote in message
news:uG******** *****@tk2msftng p13.phx.gbl...
"Ben" <be*@online.nos pam> wrote in message
news:uG******** *********@fe37. usenetserver.co m...
Hi, I'm sending out a session cookie. That is a cookie that has no
expiration date. When I surf through the site, no problems, but if I close
the browser and open it back up, the cookie is still there if other

browser
windows were open. Even if those windows didn't go to the site with the
cookie or spawn from the browser that is visiting the site. This is

causing
a problem. People want to be able to close the browser to logout.

How can I achive this in asp.net? Basically if they close the browser

that
was at the site, I want that cookie gone. The cookie persisting across
browsers that haven't touched the site seems odd...


Sorry, this isn't an ASP.NET issue, it's a browser issue. In the case of

IE, if you launch one copy of IE, then use it to create several other windows
(using Ctrl-N, for instance), then they are all running in the same process, and they share cookies. If you launch a separate process, it will not share the cookies of the first one. This may work differently with different
browsers, but I'd expect many if not most to share cookies.

You might consider using hidden form fields instead of cookies.
--
John Saunders
johnwsaundersii i at hotmail

I don't remember this being an issue in asp. Maybe it was. I'll have to
test with sessions. I didn't think sessions worked like that. Maybe I can
store a session id with the cookie.

Nov 18 '05 #3
Thanks for John's informative suggestions.

Hi Ben,

I think John's suggestions are quite correct and you may done some simple
tests to confirm this.
A simple way is enable the ASP.NET page's Trace and view the cookie
collection.
1.If we use Ctrl-N to start multi browsers when an exsiting IE is started,
they'll share cookies and Also use the
same session(since sessionId bedefault is stored in cookie)

2. IF we lanuch a new IE browser instance, they won't share the cookies(not
persistent or set expire) and will use a
new sessionID if it visit the same application

In addition, the most important is such behavior is diffferent for
different browsers. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx

Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

27
7102
by: mrbog | last post by:
Tell me if my assertion is wrong here: The only way to prevent session hijacking is to NEVER store authentication information (such as name/password) in the session. Well, to never authenticate a user from information you got from the session. Each secure app on a site must challenge the user for name and password, each and every time the...
3
1840
by: Richard P | last post by:
I am experiencing some browser weirdness. My app uses session state to hide values I prefer to keep out of the querystring. I am testing to see what happens when cookies are fully disabled in IE 6 and NS 7. NS behaves as expected: it has no recall of previous requests. With IE however my app works as normal: I can still store and retrieve...
5
4833
by: Åženol Akbulak | last post by:
Hello; I use in my web application FormsAuthentication. Also I use Session state (InProc). When a user logged in, I can read Session parameters. (For example Session). Problem is that, when user close the browser window then open a new browser, FormsAuthentication reads from cookie and user logs in. Althought user logged in, session...
8
1823
by: Mantorok | last post by:
Hi I've just been told that closing your browser closes your session on the web-site you are viewing, is this true? If so, is this the browser that initiates the closure, or the server? Thanks Kev
4
2864
by: rgparkins | last post by:
Hello I am running out of time with a problem I have running PHP 5.04 and Apache 2.0 and really need help :(. I have a page that stores a variable in session but each time I reload that page the session seems to be re-created and is an empty array. I have checked the session file and the variable is being stored against the session id, but...
13
8643
by: Samir Chouaieb | last post by:
Hello, I am trying to find a solution to a login mechanism for different domains on different servers with PHP5. I have one main domain with the user data and several other domains that need a login to show data. I want the user to login only once when he visits any of my domains.
11
3631
by: Glenn | last post by:
Hi I've been experimenting with managing state using the Session object. I've created a simple WS with a couple of methods, one which sets a string value, another that retrieves it. Each method has the WebMethodAttribute.EnableSession set to true. When I run the test page the session is maintained. However, using a console...
4
2131
by: Zhangming Su | last post by:
Hi, Can any one tell me why Session.IsNewSession doesn't work with Firwfox broswer? Z. Su
16
1827
by: Jonathan Wood | last post by:
Greetings, I was wondering if anyone here has a good understaning of the Session object. I know there are options like the Session.Abandon method and the regenerateExpiredSessionId setting, although I do not understand what they do. Can anyone tell me if it's possible for a recycled session to still contain the old data? I had a couple...
0
8347
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7973
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8220
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6626
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5718
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5394
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3844
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3879
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2358
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.