Page expiration

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
webfinearts
Forum Newbie
Posts: 12
Joined: Tue Sep 30, 2003 12:02 pm
Contact:

Page expiration

Post by webfinearts »

I need to expire some pages.
As i know following lines should me enough:

header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);

Unfortunately it seems not to be because when i'm click on the back browser button instead to display me the Page Expired mesage the old page is loaded.

Any idea?
User avatar
webfinearts
Forum Newbie
Posts: 12
Joined: Tue Sep 30, 2003 12:02 pm
Contact:

Post by webfinearts »

help please?
User avatar
JAM
DevNet Resident
Posts: 2101
Joined: Fri Aug 08, 2003 6:53 pm
Location: Sweden
Contact:

Post by JAM »

Try these...

Code: Select all

<?php
// Date in the past
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
// always modified
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
 // HTTP/1.1
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
// HTTP/1.0
header("Pragma: no-cache");
?>
User avatar
webfinearts
Forum Newbie
Posts: 12
Joined: Tue Sep 30, 2003 12:02 pm
Contact:

Post by webfinearts »

This is from PHP manual :( and is not usefull (:.
I just want to know that is smething else that has to be used. The idea is also the i'm not using in my script PHP sessions or cookies, i'm using sessions database based, but i cannot see how this will affect my page :(.
Post Reply