Deleting a Cookie - help required
Posted: Wed Nov 05, 2003 8:31 am
Hi all;
first I have the following code at the beginning of the page
Which works wonderfully and if I check the Temp Files Folder (Windows XP Pro) the cookie is there in all its glory with the SID etc. The expiry is as expected - one year hence.
however I am trying to reset the cookie so i can reuse it
it does not delete the cookie or reset the date.
First question is when would I expect to see the cookie deleted - immediately because this is what I expect.
In the if (!isset($_COOKIE['Channel-Travel'])) above does it consider a 'deleted cookie' set or not?
This is annoying me greatly - Thanks in advnace for your help
regards
Sean
?>
first I have the following code at the beginning of the page
Code: Select all
<?php
session_start();
if (!isset($_COOKIEї'Channel-Travel']))
{
setcookie ("CIA", strip_tags(session_id()), time()+3600*24*365, "/", "www.CIA.com",0);
}
?>however I am trying to reset the cookie so i can reuse it
Code: Select all
session_unset();
session_destroy();
setcookie ("CIA", "", time()-3600*24*365, "/", "www.CIA.com",0);First question is when would I expect to see the cookie deleted - immediately because this is what I expect.
In the if (!isset($_COOKIE['Channel-Travel'])) above does it consider a 'deleted cookie' set or not?
This is annoying me greatly - Thanks in advnace for your help
regards
Sean
?>