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!

When are Session variables...available?

Status
Not open for further replies.

jsteph

Technical User
Oct 24, 2002
2,562
US
Hi,
I'm having a problem dealing with session variables. I have a page that calls another page.

In Global.asa Session_OnStart I have:
session("FOO") = ""

Page 1 does:
session("FOO") = "bar"

Page 2 says:
response.write session("FOO")

Page 2 is blank--why? If, in Page 1, prior to calling Page 2, I do:
response.write session("FOO"), I get 'bar' on page 1.

I've checked the sessionID of both pages and they are of the same session. What's going on here??
Thanks,
--Jim
 
Never Mind...
It *is* a different sessionID. I don't know how or why, but it seems that ASP or IIS or whatever just starts a new session when I call the other page.
--Jim
 
Two reasons, generally (assuming timeout is not an option):
1) The cookie that holds the SessionID from IIS is not getting saved, thus you get a new one with each page load
2) Your using full URL's to go from page to page (rather than relative addresses) and your going from to (this matters for the cookies again)

 
I am not actually sure about the case thing. That may be up to the browser, but I would assume it would be case insensitive.

If they did use the IP adddress, think about how much private information I could gather just by parking a few ASP scripts on an ISP next to an e-store and just reading all ofthe cookies that the browser sent me...it wouldn't be pretty.

 
Tarwn your case temp is hotter than your CPU temp?

 
He probably has his ten gallon mug of coffee sitting next to the intake fan

General FAQ faq333-2924
5 steps to asking a question faq333-3811
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top