hedonistdahal

Registered
Sep 12, 2012
1
0
1
cPanel Access Level
Website Owner
Hello,

I have used setcookie in php to check users visiting my site. The thing is when i test it in my local server it works, the cookie gets set but when i upload the page in cpanel the cookie doesn't get set.
Below is a synopsis of my code:

<?php
session_start();
//set the cookie time to desired value;
setcookie("user", "abc", time()+3600);
//some other codes

if(!isset($_COOKIE["user"]))
{
//some other codes
}
?>

Any help will be much appreciated. Thanks :)