From 3e78f0cb5d9644fc5af6147d96b210c6c0d308bd Mon Sep 17 00:00:00 2001 From: oof2win2 Date: Wed, 4 May 2022 18:25:55 +0200 Subject: [PATCH] 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` --- docs/api-reference/data-fetching/get-server-side-props.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/api-reference/data-fetching/get-server-side-props.md b/docs/api-reference/data-fetching/get-server-side-props.md index d7e7c1ee6ef5..8eed5bffa2e3 100644 --- a/docs/api-reference/data-fetching/get-server-side-props.md +++ b/docs/api-reference/data-fetching/get-server-side-props.md @@ -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.