You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 the expires_at date/time (set to 30 days) and the halfway point (15 days).
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).
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: