#Issue with retrieving cookie value on page reload in middleware

10 messages · Page 1 of 1 (latest)

ornate mulch
#

Hi everyone! đź‘‹

I'm running into an issue with middleware. When I try to get a cookie like this:

const value = context.cookies.get("cookie-name")?.value ?? null;

It only retrieves the cookie value if I do Ctrl + F5. However, if I just press F5, the value isn't retrieved. Any ideas on why this might be happening?

vivid zodiac
#

Do you have static / hybrid mode turned on?

ornate mulch
#

I use server mode

ornate mulch
#

if anyone can help 🙂

vivid zodiac
#

Haven’t seen this problem before. Can you put up an example on stackblitz or something

ornate mulch
#

my bad, I had prerender=true in the index page

vivid zodiac
#

Glad you sorted it out

ornate mulch
vivid zodiac
#

You’re welcome.