How Auth0 know if I am already logged in?

281 Views Asked by At

I'm learning about Auth0. I can't figure out how the Auth0 JS sdk's sliently log the users for Single Page Application? They said tokens are save in memory, which means they don't know who am I when I next time open my browser, isn't it?

In below official document they say:

If the user was already logged in to Auth0 and no other interactive prompts are required, Auth0 will respond exactly as if the user had authenticated manually through the login page

https://auth0.com/docs/authenticate/login/configure-silent-authentication#successful-authentication-responses

My questions are:

  1. How they know my email address? (If SDK saves our token in memory)
  2. How they know I am already logged in? (Do they check their DB)
2

There are 2 best solutions below

3
On BEST ANSWER

After logging in Auth0 stores your session in a cookie so it is able to keep verifying if you are still logged in and also check if the cookie is still valid.

2
On

Your browser has valid session = Auth0 cookie. That cookie is sent with that authentication request and it will be used to (re)identify you.