Back

Struggle with keep session alive when closing app

  • 0
  • Self Hosted
  • Apple
vollzeitemo
7 Jan, 2024, 19:56

Hi, I am currently struggling with keeping the created session alive when closing the app completely on the iPhone.

I tried different things, like storing credentials in the keychain, that does not work for me. If the app is getting closed, the first screen when opening the app again is the Welcome page and the user is logged out. Any ideas on that?

TL;DR
User is having trouble keeping session alive when closing app completely on iPhone. Tried storing credentials in keychain but doesn't work. Looking for ideas on how to solve this issue. Solution: If using Appwrite SDK, session persistence is handled automatically. Call `account.get()` on app start to check if there's a session. If it throws an exception, redirect user to log in page.
Drake
8 Jan, 2024, 00:11

If you're using the Appwrite SDK, session persistence is handled automatically. You would need to call account.get() on app start to see if there's a session already. If it throws an exception, there's no session, so redirect the user to the log in page

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