Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Session Expires with Popup

Status
Not open for further replies.

jgos

Programmer
Sep 27, 2002
38
0
0
US
Is there a way to maintain a session when you use a popup from your application? I have a popup calendar to select dates for a form, when the window is opened using window.open() the session is lost. Is there any way with JavaScript to get around this, or for that matter any other way at all?
 
The session is not lost when you open new window using .open(). It must be something in your code to clear the session. Could you give more information on this (code, how do you know it is lost, IE or netscape ...)
 
In the session_onend in the global.asa file I set a session variable to an empty string. On each page in my include file, I check to see if the variable is empty. The .asa file is the only way that this can be emptied, no pages set this variable to an empty string. This is happening on a machine running XP with IE6. The copy of IIS that is serving the pages is running on the same machine, so the request for the pages are not going out to the internet.
 
Four possibilities off the top of my head:
[ol][li]Are you using response.redirect (or is the user clicking some sort of link) somewhere that -- even temporarily -- sends the user to a different domain? For example to an SSL-protected page using a shared host's key? If the user changes domains (for example yourdomain.com to yourdomain.secure.yourhost.com) at any point then the cookie is gone and the session is lost.

[li]Alternately are you manually clearing out the user's cookies at any point? That would kill the session, too.

[li]Is the user refusing a cookie or are the user's security settings refusing cookies? Accepting a cookie is neccessary to allow the session object to function.

[li]And of course there's always a good-old session.abandon sneaking in through some legacy code or something.[/ol]
Are any of these possibly the case?
 
You don't by any chance happen to have any underscores in your hostname? This thread mentions quite a few possiblities including a link to a M$ FAQ.

thread333-345230
 
just a suggestion: check your spelling on the Session name. I had the same problem before. Just missed one character while typing :). Took me one hour to find out.


 
I use the loopback address for everything to eliminate the need for address resolution. If you go through the site without using any of the popup calendars etc., the site works fine. Also, the site works fine under Netscape.
 
Perhaps you'll need to provide a link or post some code or something, as I'm certain pop-up windows don't kill the session normally under IE -- I would have had to struggle with this many times if so.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top