set cookie manually in next.js server action
I know there is a plugin to do this for me but i wanted to see if i could do it manually, i compared it to the cookie when i use the client instance and it seems pretty similar but my session is still undefined
do i have to use the plugin or am i missing something? i think i normalized enough to properly set the cookie
3 Replies
first you have handle multiple cookies from the Set-Cookie header (Better Auth sets both session_token and session_data cookies) and attributes as well
may be i can put a draft here -
gave it a shot same result
it seems to only return one cookie also
Solution
okay figured it out
I needed to use decodeURIComponent on the value