Solved

Cookies problem - urgent!

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Accessibility and Usability are two concepts that seem to be closely related.  But, too many people seem to have a distorted perception of them. During last five years, those two words have come to the day-to-day work of almost every web develope…
Any business that wants to seriously grow needs to keep the needs and desires of an international audience of their websites in mind. Making a website friendly to international users isn’t prohibitively expensive and can provide an incredible return…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…

706 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now