> ## Documentation Index
> Fetch the complete documentation index at: https://stytch.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Using Stytch's session layer

> Sessions provide a way to uniquely identify users on your application and maintain useful state information, such as detecting whether a user is logged in or not, determining access privileges, personalizing experiences, and building user insights.

> [card] [Start of a session](https://stytch.com/docs/consumer-auth/manage-sessions/lifecycle/start-session.md)
>
> When a user session starts.

## What is a session?

A session is a unique identifier for a user's authenticated state within your application. It ties together the user's identity, authentication factors, and session metadata.

Once a user successfully authenticates, Stytch mints a Session object for the user—represented by two tokens:

### Session represented by tokens

> [card] [User Session object](https://stytch.com/docs/api-reference/consumer/api/sessions/session-object.md)
>
> Represents an authenticated session for a specific user.

> [card] [session\_token](https://stytch.com/docs/consumer-auth/manage-sessions/jwts-and-tokens.md#using-session-tokens)
>
> An opaque token that's verified via API call.

> [card] [session\_jwt](https://stytch.com/docs/consumer-auth/manage-sessions/jwts-and-tokens.md#using-session-jwts)
>
> A signed token that can be locally verified.

Session tokens should be stored client-side (usually a browser cookie) and authenticated on each request.

***

## Session management

Stytch's SDKs provide a session management layer that abstracts token rotation, session validation, and more:

> [card] [Check for an active session](https://stytch.com/docs/consumer-auth/manage-sessions/check-active-session.md)
>
> Control your application behavior based on whether a user has an active session.

> [card] [Authenticate a session](https://stytch.com/docs/consumer-auth/manage-sessions/validate-session.md)
>
> Validate session tokens or JWTs before any action that requires authorization.

> [card] [Hydrate a session](https://stytch.com/docs/consumer-auth/manage-sessions/hydrate-session.md)
>
> Hydrate the frontend session state from the backend.

> [card] [Add custom claims](https://stytch.com/docs/consumer-auth/manage-sessions/custom-claims.md)
>
> Encode additional information into your session JWTs using custom claims.

> [card] [Cookies and sessions](https://stytch.com/docs/consumer-auth/manage-sessions/cookies.md)
>
> Options for cookie configuration and HttpOnly cookies.

### Session lifecycle

> [card] [Extend sessions & session expiration](https://stytch.com/docs/consumer-auth/manage-sessions/lifecycle/extend-or-expire-session.md)
>
> Session duration and extending the lifetime of a session.

> [card] [Revoke sessions](https://stytch.com/docs/consumer-auth/manage-sessions/lifecycle/revoke-session.md)
>
> Immediately invalidate the session token, effectively logging the user out.
