What is a Session?
A session represents an authenticated user’s state within your application. When a user successfully logs in, a session is created, storing information like the user’s ID, email, and any custom properties you choose. This session allows the user to remain authenticated across multiple requests without needing to re-enter credentials. Nile auth has two kinds of session tokens: JWT and database session tokens. For email + password, JWTs are used. For all other providers, database session tokens are used.Accessing sessions
You can access the session client side by usinguseSession
. This is rare, however, as the session contains the bare minimum information required for authorization and authentication. It is more likely you will use API requests to return information about the user (for instance, useMe()
to get user profile information)
nile.auth.getSession
.