samshers
samshers

Reputation: 3690

Are http headers shared across browser tabs?

I am aware that cookies are send from client(web browser) to server(www.example.com) for requests made across tabs or windows of same browsers. So http cookies are same across different browsers tabs for a given domain.

But from my experience, the same is not true for http headers. If a browser tab accesses server (www.example.com) and the server sends an header - "mycustomeheader: "i am example.com", then this header will not be available to other tabs with in the same browser window or other windows of same browser.

Is the above understanding correct?

Upvotes: 2

Views: 559

Answers (1)

Ori Marko
Ori Marko

Reputation: 58842

Yes, because HTTP headers are per request, because you send or expect JSON/XML/HTML per request, for example Content length header value usually will be different depends on request body

But cookies are per domain

Every time your browser makes an http request, it checks the (local) cookie database for any cookies that have a domain matching that of the request; if it finds any, it sends them along to the server

Upvotes: 3

Related Questions