Skip to content

Commit

Permalink
fix(docs): mention cookies in context (#36342)
Browse files Browse the repository at this point in the history
Mention that the HTTP.IncomingMessage object is augmented by `cookies` in getServerSideProps

## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`
  • Loading branch information
oof2win2 committed May 4, 2022
1 parent 44c89e5 commit 3e78f0c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/api-reference/data-fetching/get-server-side-props.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ You can import modules in top-level scope for use in `getServerSideProps`. Impor
The `context` parameter is an object containing the following keys:

- `params`: If this page uses a [dynamic route](/docs/routing/dynamic-routes.md), `params` contains the route parameters. If the page name is `[id].js` , then `params` will look like `{ id: ... }`.
- `req`: [The `HTTP` IncomingMessage object](https://nodejs.org/api/http.html#http_class_http_incomingmessage).
- `req`: [The `HTTP` IncomingMessage object](https://nodejs.org/api/http.html#http_class_http_incomingmessage), with an additional `cookies` prop, which is an object with string keys mapping to string values of cookies.
- `res`: [The `HTTP` response object](https://nodejs.org/api/http.html#http_class_http_serverresponse).
- `query`: An object representing the query string.
- `preview`: `preview` is `true` if the page is in the [Preview Mode](/docs/advanced-features/preview-mode.md) and `false` otherwise.
Expand Down

0 comments on commit 3e78f0c

Please sign in to comment.