Jump to content

setting a cookie


otuatail

Recommended Posts

Hi all. I have never used cookis on my website. I am trying to test for a cookie and if one is not there set one. I can see all my IE cookies together with the date. I am deleting the cookie each time and a new one is added with the latest time against it. The problem is the value of the cookie is not changing as it should. Any sugestions on this.

 

<?php
if (isset($_COOKIE['History']))
{
  echo ("Cookie = " . $_COOKIE["History"]);
}
else
{
  $time = time();
  setcookie("History", $time);
  echo $time;
}
?>

 

TIA Desmond

 

 

Link to comment
https://forums.phpfreaks.com/topic/161489-setting-a-cookie/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.