...

View Full Version : What's happening to my session variables?



Spudhead
08-16-2005, 05:25 PM
Is there something about session variables accross directories? I know that sounds daft, but I don't get this:

www.mysite.com/directory/test.asp


<%
session("foo")="one"
response.write(session("foo"))
response.write(session("baa"))
%>



www.mysite.com/different_directory/test.asp


<%
session("baa")="two"
response.write(session("foo"))
response.write(session("baa"))
%>



No matter how many times I hit those pages in succession, neither page can see the session variable that the other one is populating. Why? :(

nikkiH
08-16-2005, 07:39 PM
ASP thinks it's a new application unless you specifically set them up to share with Global.asa.

miranda
08-17-2005, 04:05 AM
do you allow unwritten cookies in your browser settings?

you dont need the global.asa file but if you have <%@ ENABLESESSIONSSTATE = False %> at the top of your page then you will get a new session id with each page and therefore will not be able to carry session variables from page to page.


If i remember correctly if you have that on one page and then change pages the value will remain false until which time you have a page with <%@ ENABLESESSIONSSTATE = True %> at which point you should be able to start using session variables again.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum