HTML Meta Cookie

Cookies are the data, stored on your computer in small text files when you access a website or a web application, which are exchanged between the web browser and web server to keep track of various information that is required by a website or a web application.

HTML Meta tag can be used to set a cookie, which can carry some useful information about a visitor.

It can be defined as below.

<meta http-equiv = "cookie" content = "userid = dummy123; expires = Saturday, 01-Jan-22 23:59:59 GMT;" />

Example

Run this on IDE

<!DOCTYPE html>
<html lang="en">
<head>
    <title>HTML Meta tag for cookies</title>
    <meta http-equiv = "cookie" content = "userid = dummy123; expires = Saturday, 01-Jan-22 23:59:59 GMT;" />
</head>
<body>
    <h1>Hello World!!</h1>
</body>
</html>

Overall

HTML meta tag can be used to define a cookie, which can carry some useful information between a web browser and a web server.

Related Links