Back

Current active session?

  • 0
  • Accounts
  • Web
Rajiv
18 Dec, 2023, 16:40

I am trying to find the active user session but the session documents returned from account.listSessions() display current: false for every session.

A workaround I am using is to decode the jwt on the client-side which contains logged in user's sessionId and comparing it to the list of sessionIds. Wondering if there's a better way to do this?

Thank you!

TL;DR
The user is asking for a way to find the active user session but is currently using a workaround by decoding the JWT on the client-side and comparing it to the list of session IDs. They are asking if there is a better way to do this.
ideclon
18 Dec, 2023, 16:41

account.getSession('current')?

Rajiv
18 Dec, 2023, 16:44

I have not tried using this, will give it a shot and let you know how it works. Thank you

Drake
18 Dec, 2023, 18:45

why do you need to get the session?

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