how to set cookies in next.js #75715
Unanswered
Nader-CS
asked this question in
App Router
Replies: 1 comment 2 replies
-
Sounds like your use case needs middleware. You set the cookie on the incoming request if its missing, and also in the response that'll be send down. Be mindful that cookies have become a bit of a legal subject. Often users have to at least be notified of their presence. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
i want anyone enter my website to have a public token and order , and i want to save them in cookies for subsquent use , if i use server component to do this , i can't set cookies , if i use client component , server component run first and some component needs those data , this is a big problem for me , how to deal with this , if i use react it pretty easy
Beta Was this translation helpful? Give feedback.
All reactions