Skip to content

Commit

Permalink
Add note about receiving Set-Cookie
Browse files Browse the repository at this point in the history
  • Loading branch information
mislav committed Jun 22, 2015
1 parent d79c4ee commit 3954929
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,16 @@ This option makes `fetch` behave similar to XMLHttpRequest with regards to
cookies. Otherwise, cookies won't get sent, resulting in these requests not
preserving the authentication session.

#### Receiving cookies

Like with XMLHttpRequest, the `Set-Cookie` response header returned from the
server is a [forbidden header name][] and therefore can't be programatically
read with `response.headers.get()`. Instead, it's the browser's responsibility
to handle new cookies being set (if applicable to the current URL). Unless they
are HTTP-only, new cookies will be available through `document.cookie`.

[forbidden header name]: https://developer.mozilla.org/en-US/docs/Glossary/Forbidden_header_name

#### Obtaining the Response URL

Due to limitations of XMLHttpRequest, the `response.url` value might not be
Expand Down

0 comments on commit 3954929

Please sign in to comment.