-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Bug in createSessionStorage
: expires
not passed to updateData
and createData
#6594
Comments
createSessionStorage
createSessionStorage
createSessionStorage
createSessionStorage
: expires
not passed to updateData
and createData
Fixed by #6598 and will be released in Remix v2 |
🤖 Hello there, We just published version Thanks! |
🤖 Hello there, We just published version Thanks! |
What version of Remix are you using?
1.16.1
Are all your remix dependencies & dev-dependencies using the same version?
Steps to Reproduce
I've been working on a remix app and one of the customizations I did was to change the session workflow in Blues stack to using my app's Postgres database to store sessions. That means I had to use the
createSessionStorage
function to create my own CRUD for the session store. It all went fine, but I noticed that myexpiresAt
field in the session model wasn't getting populated, even though I've been using theexpires
argument to populate it. Here's how I'm implementing my own session store:I added the invariant for
expires
just to see whether it's being populated or not, and sure enough, it raises the error.Here's how I'm using the
commitSession
function:Expected Behavior
Given the code above, I was expecting the
expires
argument to theupdateData
function to be populated since I'm providing anexpires
option tosessionStorage.commitSession
. I'm basing this assumption on the following quote from this doc page:Actual Behavior
However, as I mentioned above, the
expires
argument is undefined. This led me to take a look at the relevant code in the remix codebase and came across this function in this fileAnd it all makes sense. Instead of providing
cookie.expires
toupdateData
, thecommitSession
function should be providing the expiry it receives in theoptions
object. I could initialize my cookie or cookie data to have anexpires
field, but that would be a static date that gets created once. So that doesn't seem like a valid option.The text was updated successfully, but these errors were encountered: