-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: set cookie options when setting cookies in server actions #1
fix: set cookie options when setting cookies in server actions #1
Conversation
Hi. The cookie options are passed when the get session object is initialized. In the example code, you can look at
In the core library code, you can see the options that we gave as the parameter are passed through in the initializing body on line 389
and in the save function that is merged with the save options on line 398
and in the destroy function that is merged with the destroy options on line 419
So you must set your cookie options of type |
I understand, and apologies for the confusion if what I've presented is unclear. The implementation is correctly merging options downstream. However, it's not using merged options when calling Line 408 in a9932d7
There should be a third option passed to ☝️ That is what this PR addresses: |
I could also provide a repro if the problem is still unclear. Let me know 😁 |
@renchris Anymore context I can provide here to get this merged? This is otherwise going to be listed as a bug. |
@renchris I can confirm what @devjmetivier is reporting does in fact appear to be an issue. |
Hey Devin. Ah, I see and understand. Great catch! I made the changes for the fix along with updated documentation and type definitions. We no longer need the Thank you! |
This fixes
setServerActionCookie
by passing along the merged cookie options to the downstream cookie handler.