James
James

Reputation: 43667

Set cookie on local server

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');

Upvotes: 2

Views: 1376

Answers (1)

Daniil Ryzhkov
Daniil Ryzhkov

Reputation: 7596

Just don't pass $domain argument. It is not required http://php.net/manual/function.setcookie.php

Upvotes: 3

Related Questions