Skip to content

Commit cbe4632

Browse files
committed
Remove stale code block from README
1 parent 0a4e781 commit cbe4632

File tree

1 file changed

+0
-23
lines changed

1 file changed

+0
-23
lines changed

packages/cookie/README.md

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -190,29 +190,6 @@ let signedCookie = new Cookie('signed', { secrets: ['secret'] })
190190
await 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

0 commit comments

Comments
 (0)