You are here: Re: [PHP] Preventing data from being reposted? « PHP « IT news, forums, messages
Re: [PHP] Preventing data from being reposted?

Posted by Jochem Maas on 03/03/05 17:37

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
>>>>
>>>
>>>
>>>
>>>
>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация