meta tags

Meta Set-Cookie

Set the cookie in the browser . Allows you to initialize cookies on sites from static pages and without using Javascript . In modern browsers may be ignored depending on regional settings due to legislative policies in some countries. That is, in some "not our" countries the header received from the server in the HTTP response will be processed, and the one specified in the tag is not.


< meta http-equiv = "Set-Cookie" content = "NAME = value; EXPIRES = date; DOMAIN = domain_name; PATH = path; SECURE" />

Attributes EXPIRES, DOMAIN, PATHand SECUREmay be omitted if necessary:

< meta http-equiv = "Set-Cookie" content = "NAME = value; />

This cookie will be available for the current domain and will be deleted when the browser is closed, or the session, if the incognito mode is closed


NAME the name of the cookie, can not contain line feeds, spaces, semicolons (;), and tabs
EXPIRES storage time cookie. After the specified date (in the format "Wdy, DD-Mon-YYYY HH: MM: SS GMT"), the time for storing the cookie expires. if this attribute is not specified, the cookie is stored for one session, until the browser is closed
DOMAIN The domain for which the cookie value is set. For domains COM, EDU, NET, ORG, GOV, MIL, INT, the value can be set abbreviated "", it will be extended to the "WWW.MY.COM" domain. For all others (including RU), the value should be set completely "WWW.MY.RU". If this attribute is omitted, the default is the server from which the cookie was set
PATH establishes a subset of the documents to which the cookie applies. With the value "/ doc", the action of the cookie will be extended to all files and directories in this directory starting with "doc" (/ doc /, / document /, / doc2 /, docs.html, doc-test.htm). If this attribute is omitted, the cookie value applies only to the documents of the directory in which the current document is located
SECURE indicates that the information about the cookie should be forwarded via HTTPS (HTTP using). Otherwise, the information about the cookie will be sent over the HTTP protocol

Before requesting to the server, the browser checks the cookie. And if the attributes NAME, DOMAIN and PATH are the same, the browser sends a cookie to the server. If the cookie accepts the new value, the old value is deleted. The browser has a number of restrictions on the use of cookies:

  • * A maximum of 300 cookie values can be stored at a time.
  • * can not exceed 4 KB.
  • * From one server (domain) can not be more than 20 cookies.

These restrictions can be slightly different, depending on the setting and type of the browser. If the limit (common or domain) is exceeded, the first record is deleted. The deletion occurs, regardless of the value of the EXPIRES attribute. When 4 kilobytes are exceeded, the cookie is truncated.

< meta http-equiv = "Set-Cookie" content = "NAME = cookexample; EXPIRES = Fri Jun 30 2017 15:32:49 GMT + 0800; DOMAIN = WWW.MY.RU; PATH = /; SECURE" />
< meta http-equiv = "Set-Cookie" content = "NAME = cookexample;" />