Back

Modify session expire date on createEmailSession

  • 0
  • Accounts
  • Web
khashashin
2 Mar, 2023, 16:29

I have the usual "Remember me" checkbox in my login form and I want to set the session expiration time to 1 hour if the user does not tick the checkbox, is this possible?

Or do you have any other way to handle such a case? It is a very common thing, but I never had to implement such functionality, any help is very much appreciated.

TL;DR
The user wants to modify the session expiration time on the createEmailSession function. They suggest creating a collection of sessions without "remember me" and deleting sessions older than an hour. The user wants the session expiration time to be set to 1 hour if the "remember me" checkbox is not checked. They are seeking assistance with implementing this functionality.
Drake
2 Mar, 2023, 18:36

Maybe you can:

  1. Create a collection of sessions without remember me
  2. On log in, if they didn't check remember me, create a document in the collection
  3. Have an appwrite function that runs every minute or so and deletes sessions if they're older than an hour
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more