Unverified Commit 3e78f0cb authored by oof2win2's avatar oof2win2 Committed by GitHub

fix(docs): mention cookies in context (#36342)

Mention that the HTTP.IncomingMessage object is augmented by `cookies` in getServerSideProps

## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`
parent 44c89e50
...@@ -31,7 +31,7 @@ You can import modules in top-level scope for use in `getServerSideProps`. Impor ...@@ -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: 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: ... }`. - `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). - `res`: [The `HTTP` response object](https://nodejs.org/api/http.html#http_class_http_serverresponse).
- `query`: An object representing the query string. - `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. - `preview`: `preview` is `true` if the page is in the [Preview Mode](/docs/advanced-features/preview-mode.md) and `false` otherwise.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment