Skip to content

Commit

Permalink
Add include credentials example.
Browse files Browse the repository at this point in the history
  • Loading branch information
dgraham committed Sep 28, 2015
1 parent 2bfc050 commit 1afa3d2
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,15 @@ 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.

Use the `include` value to send cookies in a [cross-origin resource sharing](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing) (CORS) request.

```javascript
fetch('https://example.com:1234/users', {
credentials: 'include'
})
```


#### Receiving cookies

Like with XMLHttpRequest, the `Set-Cookie` response header returned from the
Expand Down

0 comments on commit 1afa3d2

Please sign in to comment.