Skip to content

Conversation

@oconr
Copy link

@oconr oconr commented Jun 27, 2024

What does this PR do?

There is currently an issue with Next.js where setting a cookie using cookies() and then returning NextResponse will not add the cookie to that response meaning that the session is not set and requires a refresh. This adds the cookie to the response along side setting it using cookies() to make sure that upon redirecting, the session is present.

Test Plan

I manually tested this, both as a fresh install, on existing projects and had confirmation from others that this approach worked when they were using this as repo as a starting point.

Related PRs and Issues

Have you read the Contributing Guidelines on issues?

Yes

@oconr oconr marked this pull request as ready for review June 27, 2024 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant