...

View Full Version : problem with deleting the clientside cookie



anu
08-02-2008, 06:44 AM
Hi,
Even after i am logging out my PHP web application still the cookie exist in the client browser. i am deleting the cooking using the following code

setcookie(session_name(),'',time()-3600,'/')

and i am using no cache control using the following code in all pages

header('cache control: no-cache,max-age=0,must-revalidate');
header('Pragma:no-cache');

it is clearing all browser temporary files.but still the cookie is alive. how can i manage this problem.

JohnDubya
08-02-2008, 07:14 AM
Here's how I kill my cookies, and it works fine. Does this work for you? Looks like the only difference is the time subtraction.



if (isset($_COOKIE[session_name()])) {
setcookie(session_name(), '', time()-42000, '/');
}

And are you sure you're killing the cookie BEFORE you output any HTML or anything?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum