<?php
$time1=time();
$time2=$time1+5;
echo $time2-time()."Current time<br>";
setcookie("user","Abhi",$time2);
// ECHO "<html>
// <body>
// <form action='cookie2.php' method='get'>
// <input type='Submit'> sybmit
// </form>
// </body>
// </html>
// ";
?>
<?php
while(isset($_COOKIE["user"]))
{
echo "hi ".$_COOKIE["user"];
echo time()."Current time if<br>";
}
if(!isset($_COOKIE["user"]))
{
echo "hello";
echo time()."Current time else<br>";
}
?>
When does the cookie expire?
When I run it on Firefox ,the cookie doesn't expire after 5 seconds ....
Can you tell why?