Relative Content

Tag Archive for javascriptexpressnext.js

Middleware can not access the cookie after deployment but locally it can access the cookies in next js

I have a Next js application as a frontend application for backend i am using node js express js application . Here i implemented JWT token base authentication and authorization . So i am setting the httpOnly jwt token from the backend server . In the frontend server i am accessing the token . If i can access the token from next js app then i permit user to access private routes. So my Problem is when i am runing my applications locally it was running well and i had not faced any issues but after deployment it has been setting cookies into the frontend browser well but it can’t sending cookies when i am trying to access private routes from the frontend . In middleware js can not access the cookies .