Not sure if this is what you are looking for. But this sets a cookie that is good for two months and shows the visitor when their last visit was.
<?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 "Hasn't visited in two months";
echo "Your last visit was - ". $visit;
?>