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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

very weird session variable behavior

Status
Not open for further replies.

cheyney

Programmer
Jul 16, 2002
335
CA
hello,

I have a session variable (&quot;Price&quot;) that I assign values to. I haven't been extremely careful whether I assign numbers or strings to it, but lets just suppose I might assign a string one time and a number another time. Now, when I try to write out price with <%=Session(&quot;Price&quot;)%>, it seems to pull EITHER a string variable or a previously written number variable...like its saving two different variables named &quot;Price&quot;. Is this possible? I thought setting Session(&quot;Price&quot;) to something would overwrite whatever was previously in there, regardless whether the old and new variables are the same type. Am I missing something?

Cheyney
 
>> Am I missing something?

Hey i don't know. You might be on to something. I do not think i have ever tried that. I don't have access to my server from here so I will try later. Also i will be watching this thread with interest.

-pete
 
turns out its a weird irregularity between IE 5.0 and IE 5.5...it has nothing to do with IIS (although i did find an unrelated article that might be of some interest about disappearing session states:
I was using javascript to reload the page, and I was doing this:

location.href = 'blahblah';

turns out it was loading a cached version, even though I had some no-cache code in the html:

<META HTTP-EQUIV=&quot;Pragma&quot; CONTENT=&quot;no-cache&quot;>
<META HTTP-EQUIV=&quot;Expires&quot; CONTENT=&quot;-1&quot;>

setting the location.href worked fine in IE5.5, and reloaded the page from IIS (which then reported the correct session variable), but using it from IE5.0 DIDn't reload the page from IIS and reported the OLD session variable (this is where my confusion came from).

I have since began using location.replace('blahblah') and this seems to work fine.

cheyney
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top