Continue

 Setting Cookies

Cookies are data, stored in small text files on your computer and it is exchanged between web browser and web server to keep track of various information based on your web application need.

You can use <meta> tag to store cookies on client side and later this information can be used by the Web Server to track a site visitor

Example

 Following is an example of redirecting current page to another page after 5 seconds.if  you want to redirect page immediately then do not specify content attribute.

<!DOCTYPE html>

<html>

<head>

<title>Meta Tags Example</title>

<meta name="keywords" content="HTML, Meta Tags, Metadata" /> <meta name="description" content="Learning about Meta Tags," />

<meta name="revised" content="Tutorialspoint, 3/7/2014" />

<meta http-equiv="cookie" content="userid=xyz; expires-Wednesday, 88-Aug-15 23:59:59 GMT;" />

</head>

<body>

<p>Hello HTML57</p>

</body>

</html>


If you do not include the expiration date and time, the cookie is considered a session cookie and will be deleted when the user exits the browser.


Note: You can check PHP and Cookies tutorial for a complete detail on Cookies.

Comments

Popular Posts