Set a second cookie with additional time. For example:
// set a cookie that shows they have already
// been counted that will expire in 24 hours
setcookie ("counted", "1", time()+86400);
// set a userId cookie that expires in 1 year
setcookie ("userId", $userId, time()+31536000);