Skip to content
Back

[SOLVED] Best way to check if a user has a current session

  • 0
  • Users
  • Web
BloodThermic
29 May, 2023, 00:39

I am trying to see what the best best way to check if a user has a current session without doing a account get api call

TL;DR
Title: [SOLVED] How to Check if a User has a Current Session Solution: The best way to check if a user has a current session without making an account get API call is to use the get session function. This function allows you to look for the current session and determine its validity. Additionally, you can add a custom domain to your API endpoint to increase security.
Drake
29 May, 2023, 00:42

That is the best way because what if the session was revoked? Only the server can tell if the session is still valid

BloodThermic
29 May, 2023, 01:18

Ok thank you

BloodThermic
29 May, 2023, 01:26

What is better get session or get account

Drake
29 May, 2023, 01:27

Get account since it's cached. Get session requires extra logic to look for the current session

BloodThermic
29 May, 2023, 01:32

Ok ty

BloodThermic
29 May, 2023, 01:42

Why would I not have cookies created when the create session function runs successfully

BloodThermic
29 May, 2023, 02:44

This is a warning I get

appwrite is using localStorage for session management. Increase your security by adding a custom domain as your API endpoint. w

Drake
29 May, 2023, 02:46
BloodThermic
29 May, 2023, 03:05

I am using port :3080 would i just use a srv record

BloodThermic
29 May, 2023, 03:31

[SOLVED] Best way to check if a user has a current 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