want to make user loggedin for long time how can i implement it?
- 0
- Web
- Android
- Accounts
- Apple
- Users
first two images are for login
i used it signed up and logged into home screen after exiting app i am again redirected to login page i should login again and again..... how can i handle this problem how to make user to stay logged in for long time?
What I usually do is have a block of code in the login/signup page (whichever is your default), that first checks whether the user has an active session.
If they have an active session, redirect them to the suitable page. If they don't have a session, stay on the page and ask them to login/signup
a simple way to do this is to use account.get()
ohh okay
Essentially, if the user has an active session, account.get() will return a response. If there is no session, you will get an AppwriteException, that you can catch.
@Ahmed if you have any other questions in this particular topic, please tag me and ask away! For questions on a different issue, please make a new post 😄
Let me know how it goes!
why new post @safwan ?🥲
i'll ask question itself here.
no like, if you have question about a different issue, make a new post.
ohh okay boss
if it's the same issue, feel free to ask here!
can we use asyncStore with it
?
Hey sorry for the late reply just saw this message.
asyncStorage is used for persisting data on the device. What do you want to store on the device when a user logs in?
@Ahmed
Recommended threads
- Site deployment keeps getting failed
Hi good folks, need a hand with Sites deploy Error on every deploy: Synchronous function execution timed out... duration doesn't exceed 30 seconds [exact log ...
- Unknown attribute type: varchar / text
Since the `string` type is deprecated I tried using `varchar` and `text` in some newer tables, but when running `appwrite pull tables && appwrite types ./src/li...
- trying to figure out how to activate my...
please help