mdn / sprints

Archived: MDN Web Docs issues are tracked in the content repository.
https://github.com/mdn/content
Creative Commons Zero v1.0 Universal
150 stars 142 forks source link

https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cookie #3923

Closed andreElrico closed 3 years ago

andreElrico commented 3 years ago

Request type

Details

Web technology for developers > HTTP > HTTP headers > Cookie

The Cookie HTTP request header contains stored HTTP cookies previously sent by the server with the Set-Cookie header.

When in javascript I manipulate my cookie via document.cookie that updated cookie is still send in the request header? So not only received by set-cookie?

hamishwillee commented 3 years ago

This is neither a correct or an update.

The simple answer is yes, see Web/HTTP/Cookies. Cookies you set will be send with the page.

Of course there are some cookies you can't set/change because they can't be accessed in JavaScript - ie. those with HTTPOnly set when in a different origin

I have modified that introduction to make this point

The Cookie HTTP request header contains stored HTTP cookies associated with the server (i.e. previously sent by the server with the Set-Cookie header or set in Javascript using Document.cookie).