Solved

Cookies problem - urgent!

Posted on 1998-11-19
5
198 Views
Last Modified: 2013-12-25
I am doing an asp page to test if the visitor has the cookies property enabled in his/her browser.
This page drops a cookie with a 3 minute expiration period, than redirects to it self and then tries to retrieve the cookie. If it is successful than the cookies are activated, otherwise they're not. In either case a message is displayed.

The problem is that this works with Netscape but not with IE 3 or IE4. With either one of these browsers the message is not displayed. It seems that the browser is caching the page and it does not display the message. But the curious detail is that when I reenter the URL where the last redirection is made manually it works (at least in IE4).

What is the problem ?
0
Comment
Question by:aloha
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 10

Expert Comment

by:MasseyM
ID: 1856487
like you said, IE is caching the page.  In your HTml you need to add this to the VERY top of the ASP page:

<%
response.expires = 1    ' This is in minutes
response.expiresabsolute = #7/5/1945 00:00:00#  ' A long time ago
%>

This will kill the caching of the page.
0
 

Author Comment

by:aloha
ID: 1856488
It doesn't work. I had already tried with response.expires and it didn't work.
Any other ideas ?
0
 

Expert Comment

by:bslavin
ID: 1856489
One way to test if it truly is caching is to eliminate the caching.  Try a <%= NOW()%> at the bottom of the page to echo the current time.  This way, the page is never the same.

If you are still getting the problem, it is not a caching issue.
0
 
LVL 10

Expert Comment

by:MasseyM
ID: 1856490
Did you try the expiresabsolute?  They are two different things.
0
 
LVL 8

Accepted Solution

by:
jhurst earned 100 total points
ID: 1856491
The easiest way to disable the cache, and the nice thing about it is that it does not require any of the newer browser features, is to re-direct yourself to the same page but add a ?xxx to the end of the url, for example:

<script>
document.location.href+='xxx';
</script>
Actually, I would make xxx a random number or some function of the time so that it really is unlikely ever to be in the cache.  We have found problems similar to yours and this is an easy, quick and safe solution, as long as Javascript is enabled.

0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
This article was originally published on Monitis Blog, you can check it here . Today it’s fairly well known that high-performing websites and applications bring in more visitors, higher SEO, and ultimately more sales. By the same token, downtime…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

630 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question