Replies: 7 comments 1 reply
-
@indify-co |
Beta Was this translation helpful? Give feedback.
-
@indify-co @Manikanta-20 How did you solve the problem? |
Beta Was this translation helpful? Give feedback.
-
One workaround i've found is setting the cookie in the response header
Then you can read the cookies in the request OR from the cookies directly. Something like:
|
Beta Was this translation helpful? Give feedback.
-
It might be related to the cookie policy. See @richard Garside's answer: https://stackoverflow.com/questions/40781534/chrome-doesnt-send-cookies-after-redirect/66601926#66601926 |
Beta Was this translation helpful? Give feedback.
-
You have to set the cookie samesite attribute to "lax" |
Beta Was this translation helpful? Give feedback.
-
facing same issue |
Beta Was this translation helpful? Give feedback.
-
facing the same issue in dot net core 5, I have set the cookie same site to lax, and the problem is still there, |
Beta Was this translation helpful? Give feedback.
-
Hello! I've been trying to debug this issue for weeks and have not been able to find a solution to it, so any help would be greatly appreciated.
Context
I have a NextJS app that stores a session cookie to allow the user to remain logged in. Once logged in, the user can open a checkout session in Stripe, which then passes in a redirect URL for Stripe to use when the user is done with the checkout flow.
Normally, when Stripe redirects back to my website, I would expect the user's session cookie to be available so that I can keep them logged in. This session cookie is read from
getInitialProps
in_app.js
, and is used to load a logged-in view.The problem
Currently when Stripe redirects back to my website, the cookies are empty so the user appears logged out. Only when I refresh the page do the cookies actually get populated.
I noticed in the network tab that when Stripe redirects back, this sets the
Sec-Fetch-Site
header tocross-site
, meanwhile refreshing it manually sets it tosame-origin
. Is it possible this header is causing this behavior?Beta Was this translation helpful? Give feedback.
All reactions