File tree Expand file tree Collapse file tree 1 file changed +0
-23
lines changed Expand file tree Collapse file tree 1 file changed +0
-23
lines changed Original file line number Diff line number Diff line change @@ -190,29 +190,6 @@ let signedCookie = new Cookie('signed', { secrets: ['secret'] })
190190await signedCookie .parse (' signed=value.badsignature' ) // null
191191```
192192
193- ``` ts
194- // In your Remix loader/action
195- import type { LoaderFunctionArgs } from ' @remix-run/node'
196- import { Cookie } from ' @remix-run/cookie'
197-
198- let sessionCookie = new Cookie (' session' , {
199- secrets: [process .env .SESSION_SECRET ],
200- httpOnly: true ,
201- secure: true ,
202- sameSite: ' lax' ,
203- maxAge: 60 * 60 * 24 * 30 , // 30 days
204- })
205-
206- export async function loader({ request }: LoaderFunctionArgs ) {
207- let cookieHeader = request .headers .get (' Cookie' )
208- let session = await sessionCookie .parse (cookieHeader )
209-
210- return {
211- user: session ?.userId ? await getUser (session .userId ) : null ,
212- }
213- }
214- ```
215-
216193## API Reference
217194
218195### ` Cookie ` Class
You can’t perform that action at this time.
0 commit comments