use next/headers in nextjs page router
Unanswered
Transvaal lion posted this in #help-forum
![Avatar](https://cdn.discordapp.com/embed/avatars/2.png)
Transvaal lionOP
I'm curios as what is the alternative of extracting cookie from the headers fn in page router nextjs? i'm trying to apply this config in my app https://nextjs.org/docs/app/api-reference/functions/headers but unfortunately they have only an example for app router
10 Replies
![Avatar](https://cdn.discordapp.com/embed/avatars/2.png)
Transvaal lionOP
bump bump
![Avatar](https://cdn.discordapp.com/embed/avatars/5.png)
Asian paper wasp
So you want to access cookies in App Router, is that what you are asking for?
If yes, https://nextjs.org/docs/app/api-reference/functions/cookies
If yes, https://nextjs.org/docs/app/api-reference/functions/cookies
![Avatar](https://cdn.discordapp.com/embed/avatars/2.png)
Transvaal lionOP
nope, i'm trying to find a way to access cookies in the page router
![Avatar](https://cdn.discordapp.com/avatars/1011594178934878248/3dcc464b55267c406f84c2c541ac00df.webp?size=256)
averydelusionalperson
check this out: https://www.npmjs.com/package/cookies-next
![Avatar](https://cdn.discordapp.com/embed/avatars/0.png)
Short mackerel
Do you have Client and Server Rendering?
![Avatar](https://cdn.discordapp.com/embed/avatars/2.png)
Transvaal lionOP
dope, will check this out!
well i guess that via page router, i would have to hydrate them on each page. but gonna check link above from @averydelusionalperson
![Avatar](https://cdn.discordapp.com/avatars/1011594178934878248/3dcc464b55267c406f84c2c541ac00df.webp?size=256)
averydelusionalperson
@Transvaal lion Consider closing the thread if your problem has been solved
![Avatar](https://cdn.discordapp.com/embed/avatars/2.png)
Transvaal lionOP
will do, still trying to find a solution for the hydrating the cookie with page router like in app router for one lib that i'm using ( https://wagmi.sh/react/guides/ssr#_2-hydrate-the-cookie )
![Avatar](https://cdn.discordapp.com/avatars/1011594178934878248/3dcc464b55267c406f84c2c541ac00df.webp?size=256)
averydelusionalperson
Sure