Solved

Cookies problem - urgent!

Posted on 1998-11-19
5
179 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
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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
This code tracks birthdays 3 73
WIX Redirect 1 48
Best practice for a landing page 3 63
business account would work BUT i do not want to use business account 2 62
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

777 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