Am using WAMP server for PHP development. I have created a cookie in my php but can’t locate the cookie file being created. The php.ini reads session.save_path=C:/wamp/tmp and none of the files have been created today. The code is:
<?php
$mycookie="mycookie";
$emailAddr="abc@gmail.com";
if (!isset($_COOKIE[$mycookie]))
{
if (!setcookie($mycookie, $emailAddr, 0))
{
echo "Cannot set cookie";
}
else
echo "Cookie is set";
}
?>
I get “Cookie is set” message but checking C:/wamp/tmp does not see any cookie file created today.
Cookies are stored individually depending on a browser. they store them in their own folders.
what you are setting in your php.ini is the session path. which is the path for saving sessions
$_SESSIONnot cookies$_COOKIES.