I'm using nookies and i'm having a hard time sharing cookies between my app and website. To gain full voting privileges, There's a fairly popular library called nookies to help with cookies in a next.js project.
If you can load the page then fetch the data there is a performance cost to using. You'll need to complete a few actions and gain 15 reputation points before being able to upvote. I already used a similar code to set up a cookie with the nookies and it worked just fine.
Another way would be using cookies instead of using localstorage, i had the same problem when i developed my last application and i solved it using the nookies package Upvoting indicates when questions and answers are useful. I use nextjs with serverside rendering i use an authentication service with access_token (jwt) i can't store access_token in the localstorage because it's not available. This is the code i use on my app.mydomain.com file:
I have this nextjs app where i'm trying to setup my authentication/authorization system. I am trying to set a cookie with nookies npm package using next.js api folder.