htmlmetahttp-equiv

How does meta tag with attribute http-equiv work under the hood?


I heard that the meta tag in html can be used to specify response key-value pairs, if so, how does it work under the hood? How does the server responding with html page understands the meta tag before the html parser parses it?

Example of the meta tag:

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

Solution

  • I heard that the meta tag in html can be used to specify response key-value pairs

    In very limited terms.

    if so, how does it work under the hood? How does the server responding with html page understands the meta tag before the html parser parses it?

    It doesn't. It is interpreted by the browser.

    Example of the meta tag

    cookie is not a valid value for http-equiv. I think you meant set-cookie which is marked as non-conforming in the specification so you should not use it.

    ā€ is not a valid attribute delimited character either. You need " or '.