-
-
Notifications
You must be signed in to change notification settings - Fork 495
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
Session never validate as fresh - session.fresh: false #1681
Comments
Related issue: #1668 |
Note whether you are using _id or id: existingUser._id and existingUser.id are different things. When creating a user in the database, don't generate the _id yourself. (Just my opinion) Everything is working for me. |
@zacharybenson I was a bit confused by this one, but "fresh" just means that you want to update the session cookie, if you get a session back it's valid, even if fresh is false. |
|
Sessions are always marked as stale (
fresh: false
), even if they were just created. This is happening despite the current date/time being before both theexpires_at
date/time (set to 30 days) and the halfway point (15 days).Context:
Troubleshooting Steps:
validateSession
method and called it directly, but I got the same result as when calling throughlucia.validateSession
.It seems like this section of the
validateSession
method always evaluates tofalse
:I dug deeper and looked at the
isWithinExpirationDate
method fromOlso , which simply calls:
I believe that the issue it the "!" condition being applied at line 145 - as it causes a fresh session to switched to be evaluated as false and in turn making the session return (
fresh: false
).lucia/packages/lucia/src/core.ts
Line 145 in cfe8251
Was that the intended outcome and I have the wrong understanding of what fresh means?
Thank you for your help!
The text was updated successfully, but these errors were encountered: