Re: Preventing data from being reposted?

From: Date: Thu, 03 Mar 2005 15:37:31 +0000
Subject: Re: Preventing data from being reposted?
References: 1 2 3 4 5 6 7 8 9 10  Groups: php.general 
Request: Send a blank email to php-general+get-209925@lists.php.net to get a copy of this message
rory walsh wrote:
I'm pretty sure I am looking at cached pages but the problem with this seems to be that some browsers support these header directives and others don't, i.e. Firefox. The following work in IE but not Firefox header("Cache-control: private"); header("Cache-Control: no-store, no-cache, must-revalidate");
I'd guess that should work but maybe the 'private' throws firefox a curveball, anyway here are the headers I use to 'privatise' logged in sessions:
        header("Expires: ".gmdate("D, d M Y H:i:s", strtotime('1-Jan-1980')) . " 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");
I put that lot together from trial and error more than anything, if it sucks then somebody please say something! 1 piece of advice when debugging stuff to do with sessions: everytime you test whatever it is your doing close all you browser windows (kill the app) first then open a new browser and then perform the actions you want to test. and just to be absolutely sure first clear the browser cache.
maybe you are looking at cached pages in your browser? if 'session_variable=="yes"' equates to true then you should send out headers that tell the browser not to cache the output (or make it private/force-revalidation)
Jochem Maas wrote:
eoghan wrote:
i think ive missed a few mails there...? rory walsh wrote:
Cheers, I'll take a look, I had tried a search but thunderbird didn't find anything, even with the exact thread title I had to google it? Anyway I'll take a look.
my first google hit on search for the exact title gave me this: http://www.issociate.de/board/post/171234/Clear_POST_variables_on_page_refresh.html


« previous php.general (#209925) next »