Solved

Cookies problem - urgent!

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

Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

Question has a verified solution.

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

FAQ pages provide a simple way for you to supply and for customers to find answers to the most common questions about your company. Here are six reasons why your company website should have a FAQ page
CTAs encourage people to do something specific to show interest in your company, product or service. Keep reading to learn why CTAs should always be thought of as extremely important, albeit small, sections of websites.
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:
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…

734 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