How can i use cookies in php?

Cookies can be set in PHP using the setcookie() function.

Example:


  setcookie('user', 'JohnDoe', time() + 3600, '/');
  

Beginner's Guide to PHP