PDA

Click to See Complete Forum and Search --> : Is there any Script to clear cookies on every time when the page gets loaded byguest?


thenoob
Mar 22nd, 2009, 11:47 AM
Dear Viewers,

Let me say you a scenario where we do regular updates for our blog. After updation we clear the browser cookies or refresh the page atleast to view the updated changes, knowing already that the content has been updated.

But how will the clients or other viewers who are regular visitors of our site know the updated changes, who may not refresh or clear the cookies ?

Is there any script or anything of that sort that clears the cookies or refreshes the pages each time when it gets loaded or any other solution for this problem.

I have been advised of <META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">

does anyone know of some code I can put into my PHP to clear the cache from certain pages???

thanks.

kows
Mar 22nd, 2009, 08:17 PM
if you don't want your pages to be cached, send a header. make sure you're sending it before you output anything to the browser.
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past
from the manual's header() (http://ca.php.net/manual/en/function.header.php) page.