I'm developing a site on local server, so the url of the site is http:/goodies/, there is no domain ending like ".com"
How can I make this code work?
setcookie('user', $user_check, time() + (86400 * 3), '/', 'goodies');
Just don't pass $domain
argument. It is not required http://php.net/manual/function.setcookie.php