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!

session variable: IE doesn't read it unless I try twice; Firefox works 1

Status
Not open for further replies.

artguy

Technical User
Feb 2, 2001
117
US
I'm setting a simple session variable with this script to let me know the next time a person comes to the home page to not display the Flash component:

<%
Session("flash") = "played"
%>

That works fine. But when I run this code to read it in IE the first time, it doesn't output anything until I rerun this exact same code then it spits out the correct response:

<%
If Session("flash") = "played" Then
Response.Write("&flash=played")
End If
%>

This all works great in Firefox every time. The code above exist in 2 separate files and is the only code in each respective file.

Any ideas or places to point me in the right direction would be very much appreciated. I've searched for an answer but either one I'm the only one this has happened to or I'm searching for the wrong thing.

Thanks.

Bob
 
The server script shouldn't care what kind of browser is being used.

Check the output of your ASP in IE using ViewSource to make sure this isn't barkin' up ye olde wrong tree.
 
Correct. The server script shouldn't care one bit, unless IE decided, "ehh, I don't feel like even asking the server for that page." or something!

If I run the second script once, the source code look like this:

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=windows-1252"></HEAD>
<BODY></BODY></HTML>

Which isn't anywhere to be found in the code so it must be IEs default code for a blank page.

If I immediately rerun that same script I get this:

Code:
&flash=played

which is exactly what it should do.

I just doesn't make ANY sense! I've been pulling my hair out for the past 2 hours trying to figure it out.

bob
 
Is it possibly a browser setting? The cache perhaps? Is IE set to always check for a new version of the page?
 
If you set IE to check EVERY TIME to check the page version, instead of AUTOMATICALLY, then it works. Thank you for figuring that out. Thanks again, Sheco!

Now, the next question is...is there a way around this so IE will load that page each time without assuming it's the same? Which of course, the page didn't change but I still want IE to load it anyway!

I'm sure there probably isn't any way to do that, but at least I'm asking in case someone may have an idea.

bob
 
There are some things you can put in your ASP that will tell the browser not to cache the page if that is what you mean?
 
Yes. That should do the trick. I'll have to look for that ASP code. Unless you know it off the top of your head.

Thanks for all of your help.

bob
 
Sorry. I posted my last comment before I saw your FAQ post.

Thanks again, Sheco!

bob
 
YES!!! That was the whole issue! IE was just caching the page and never loading again. By using the code you sent from the FAQ, it instructed the browser never to cache that page.

Now it works beautifully!

Thanks for all of your time and knowledge!

Bob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top