FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Deleting cookies
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Deleting cookies [message #169820] Mon, 27 September 2010 16:58 Go to previous message
MikeB is currently offline  MikeB
Messages: 65
Registered: September 2010
Karma:
Member
As I understand it, detting and deleting cookies has to be done *before*
any other text or headers are sent to the browser.

So, should this example delete all cookies that my session can see?

There is one cookie that seems to live beyond this, and I can't figure
out why.

Thanks

--------------

<?php
foreach ($_COOKIE as $ck => $c) {
$cookies = array();
$exp = time()-3600;
$result = setcookie($ck, $c, $exp);
$cookies[] = "<br />Result = $result (setcookie($ck, $c,
$exp)";
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Delete cookies</title>
</head>
<body>
<?php
echo "<pre>";
print_r( $cookies);
echo "</pre>";
?>
</body>
</html>
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Route/Link to an action works with http, but NOT with httpS (SSL!)
Next Topic: Re: OT SSL Certificate
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Wed Nov 27 06:52:42 GMT 2024

Total time taken to generate the page: 0.03356 seconds