Rank 3: Container
In the console where we can determine the session length... I want to ask (let's assume I set it to 7 days) if this means that the session will expire 7 days after creation or after user inactivity. Thanks
Votes
0
Replies
15
Participants
Unknown
Messages
16
Rank 3: Container
In the console where we can determine the session length... I want to ask (let's assume I set it to 7 days) if this means that the session will expire 7 days after creation or after user inactivity. Thanks
In total
The check is against the createdAt attribute
https://github.com/appwrite/appwrite/blob/master/src/Appwrite/Auth/Auth.php#L367
Rank 3: Container
I see. How then do you suggest I detect users who have not been online or active for (let's say) the past 30 days?
Rank 3: Container
Another question is: Will the "current" property of the session object be changed to false after session has expired?
What you mean by change to false?
Rank 3: Container
This.
This means if you ask for all sessions, like for a few devices then to the current one will be true
If the session is expired then no session will return whatsoever
Rank 3: Container
I see. That helps
That's a good question.
A best solution would be Appwrite adds it to the account.get() endpoint and part of the user model.
For now, you'll have to create some collection and let it update by:
Then you can query that collection by checking only rows that after X date.
To make sure this collection won't get bigger and bigger you can make the user_id unqiue, then only enter once and then update the user last seen.
Rank 3: Container
Perfect. Makes perfect sense
Rank 3: Container
Last question...
Rank 3: Container
Can the $createdAt attribute be queried with the greater than and less than queries? Cos I was having a feeling they may only work on integer attributes
Yes it could
You'll need to send a ISO date to the query
Rank 3: Container
Alright. Thank you very much