Next.js Discord

Discord Forum

Cookie undefined in middleware

Unanswered
Sun bear posted this in #help-forum
Open in Discord
Sun bearOP
hi guys!
I have an httpOnly session cookie that I'd like to access via middleware, trying to access it via
cookies()
from
next/headers
but cookie is undefined (tried setting "credential: include" for the fetch api - did not work

2 Replies

Sun bearOP
I could make it work when I switched to use client component which is basically not what I want
:/