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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Auto Expire Webpage from Within Perl 2

Status
Not open for further replies.

Panthaur

IS-IT--Management
Jul 26, 2002
78
US
Hi all,

I'm trying to figure out how to auto-expire a web page once I leave that page and go onto another one.

I have seen a number of web pages that if I click the "back" button, it says the page has expired, and I want to be able to use that capability as well.

I am using perl in the cgi-bin directory for my app running on Apache.

PLEASE HELP!

Pan
 
use cookies to expire almost immediately on serving the page, and the first job of a reload is to check for an unxpired cookie.

Have a look at CGI.pm, and CGI::Session.pm on search.cpan.org

HTH
--Paul
 
I use a cookie right now to identify a user. Won't using your method interfere with my ability to identify, or can I use multiple cookies to do the same thing?
 
Now that's a good un
--Paul

It's important in life to always strike a happy medium, so if you see someone with a crystal ball, and a smile on their face ...
 
Setting the "expires" header won't give the exact behaviour that Panthaur is looking for. Just to clarify, it will cause the browser to cache the script's output for a particular period, after which it will have to run the script again to get fresh output. The "This page has expired" message is IE's default message when you press the back button to get back to a script that accepted POST data, rather than GET.
 
Setting expires in the past may work.

But ishnid may be correct. IE does things in its own way..

Anyone want to test it and let us know what happens? :)
 
Think you may be able to set the expiry to zero to prevent cacheing. Most banks etc. do this to prevent sensitive data from being cached locally, for security reasons...
 
siberian,

Thanks for the snippet. It wasn't "exactly" what I needed because I don't use cgi.pm, but this is what I did:

print "Content-Type: text/html\n";
print "Expires: Saturday, 1-Jan-83 00:00:00 CST\n\n";

It thereby forces my page to expire and my problem seems to be gone. I have to do a lot more testing, but things seems good now.

Pan

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top