Secure Cookies #6052
Unanswered
TylerAHolden
asked this question in
Help
Secure Cookies
#6052
Replies: 3 comments 4 replies
-
Nevermind I found a very helpful article here that explained a different approach: https://maxschmitt.me/posts/next-js-http-only-cookie-auth-tokens/ |
Beta Was this translation helpful? Give feedback.
1 reply
-
I'm having the same issue. trying to set a cookie with Is Vercel having some kind of HTTP proxy that's HTTP and that's causing this? |
Beta Was this translation helpful? Give feedback.
3 replies
-
The solution pillarjs/cookies/issues/142 worked for me! The const cookies = new Cookies(req, res, { secure: process.env.NODE_ENV === 'production' });
cookies.set(NEXT_AUTH_SESSION_TOKEN_COOKIE_NAME, sessionToken, {
expires: sessionExpiry,
secure: process.env.NODE_ENV === 'production',
}); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I try to set a secure cookie via an API serverless route I receive an error: "Cannot send secure cookie over unencrypted connection". I'm using a custom domain but all of the certs are valid so it is going through HTTPS. Is this an issue with something related to Vercel's serverless infrastructure?
Beta Was this translation helpful? Give feedback.
All reactions