Nextjs middleware not working
In this i am using the getSessionCookies()
but the sessionCookie returns as null
i am using the cookiePrefix also
my session also getting from useSession
i checked the cookies in the network also after the session checking it is also there
my frontend is next js in local enviornment and the backend is in elysia js in deployed version
do any know how to fix this


11 Replies
are you on latest?
yes
what do u know mean by vanilla client sir ?
can u please explain which way i should use
should i use getSessionCookie or authClient.getSession ?
@bekacru
You can use package
@better-fetch/fetch
for getting session in middleware like this:
@Shyam Verma
??
should i change the cookie to my cookie name ?
what's the need of this. use defaults names
if i use default name would it work?
Yes, definetly
i removed the prefix still not worked
@shabiii send us your auth config for more clarify