A cookie is often used to identify a user. a cookie is a variable that is stored on the visitor's computer.
Whenever this visitor's computer requests a page with a browser, it will send the cookie too.
The cookie is basically used to store information about the visitor like name of the visitor, which browser he is using, the version of the browser, the date of his last visit etc.
setcookie() function is used to set a cookie and must appear before the <html> tag.
setcookie(name, value, expire, path, domain)
<?php setcookie("user", "Harry Potter", time()+3600); ?> <html> <head> <title>PHP COOKIE</title> </head> <body> </body> </html>
Type Url -