getSessionCookie does not work in middleware
I was trying to use getSessionCookie just now with my middleware and i kept getting null.
getSessionCookie
is imported in the above snippet via import { getSessionCookie } from "better-auth/cookies";
i replaced it with a super simple stand-in util like this for now:
it works. but i hope yall find and fix the issue.
more info on the env:
1 Reply
If you didn't changed the cookieName, you could remove that line that defines the name. I had that too and it didn't worked for me so i kept it default. the prefix should be good tho