
What is the best way to check if a user session exists? We are using the Web SDK and using either account.get()
or account.getSession('current')
however, when a user isn't logged in we get a 401 response which throws an error in the console.
is there a better way to be checking for user session?

account.get()
is the best way. if it executes successfully, they are logged in. Otherwise, check the error

Hey Steven! Thanks for the quick response. Will the error show in the console of the browser in production?
Recommended threads
- I can't use any Oauth
Login using oauth will be rejected because the redirect url does not match but appwrite give me the redirect url is https://**************/v1/account/sessions/o...
- Getting CORS error for GraphQL query on ...
Getting CORS error when making GraphQL queries using Appwrite's SDK in Next.js (client-side). Login/signup works fine. Only GraphQL is failing on both localhost...
- Sites: Cold start execution timed out.
**SITE ID:** _6850190a0005992d129a_ The issue started after a GitHub-triggered deploy. I tried a manual redeploy, but the problem persists.
