0

This is my php cookie code,

setcookie("city_id", $cityData[0]['city_id'], 2147483647, "/", "localhost");
setcookie("cityname", $cityData[0]['cityname'], 2147483647, "/", "localhost");

echo $_COOKIE['city_id'];
echo $_COOKIE['cityname'];

Above code is working fine on FF, but not working in Chrome.... Any suggestions....

Mangesh Sathe
  • 1,987
  • 4
  • 21
  • 40

1 Answers1

0

Your setting the timestamp well into the future which could be a problem in FF.

Try setting it a year from today instead - replace 2147483647 with strtotime('+1 year')

I doubt you'll still need the cookie to be set in 2038, we will probably all be living on Mars by that point.

fire
  • 21,383
  • 17
  • 79
  • 114