Fastify setCookie not setting cookies

33 views Asked by At

I have a back-end using fastify and a nextjs front end, im trying to set a cookie on my browser using this code but is not working.

if (!sessionId) {
      sessionId = randomUUID();

      reply.setCookie("sessionId", sessionId, {
        path: "/",
        maxAge: 60 * 60 * 24 * 7, // 1 week
        signed: true,
        httpOnly: true,
      });
}

https://github.com/MatthewAraujo/polls/blob/main/backend/src/http/routes/vote-on-poll.ts this is the github repo where im using the setCookie

https://github.com/MatthewAraujo/polls/blob/votes/frontend/src/components/Poll.tsx this is the github repo where im fetching de route for setCookie

I tried to get my cookies in the browser and this is not happening

0

There are 0 answers