Page 1 of 1

XAMPP don't remember cookies

Posted: Tue Jan 11, 2011 7:56 pm
by shamkawai
I am using php on xampp locally.
I have created a script

Code: Select all

<?php
$inTwoMonths = 60 * 60 * 24 * 60 + time(); 
setcookie('lastVisit', date("G:i - m/d/y"), $inTwoMonths); 

if (isset($_COOKIE['lastvisit']))
$visit=$_COOKIE['lastvisit'];
else
echo "no cookie yet, come back later </br>";

?>
it runs properly on the browser, no error.
except it will only give me no cookie, no matter how many times i close and reopen the browser to this script.
Thank you!

Re: XAMPP don't remember cookies

Posted: Wed Jan 12, 2011 12:31 am
by kalpesh.mahida
cookies are stored on a user's computer by browser. check if storing cookies is disabled or not for your browser.