View Full Version : problem with deleting the clientside cookie

08-02-2008, 07:44 AM
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


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

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

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

08-02-2008, 08: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?