---
title: SessionContext
description: Provides access to information about stateful and stateless sessions.
component: pinggateway
version: 2025.9
page_id: pinggateway:reference:SessionContext
canonical_url: https://docs.pingidentity.com/pinggateway/2026/reference/SessionContext.html
llms_txt: https://docs.pingidentity.com/pinggateway/llms.txt
docs_for_agents: https://developer.pingidentity.com/build-with-ai/docs-for-agents.md
superseded_by: https://docs.pingidentity.com/pinggateway/2026/reference/SessionContext.html
section_ids:
  Session-properties: Properties
  Session-moreinfo: More information
---

# SessionContext

Provides access to information about stateful and stateless sessions.

To process a single request, consider using [AttributesContext](AttributesContext.html) to transfer transient state between components and prevent PingGateway from creating additional sessions.

PingGateway automatically provides access to the `session` field through the `session` bindings in expressions. For example, to access a username with an expression, use `${session.username}` instead of `${contexts.session.session.username}`

## Properties

The context is named `session`, and is accessible at `${contexts.session}`. The context has the following properties:

* `"session"`: *[java.util.Map](https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/Map.html)*

  A map with the format `Map<String, Object>`, where:

  * Key: Session property name

  * Value: Session property value

  Any object type can be stored in the session.

## More information

[org.forgerock.http.session.SessionContext](../_attachments/apidocs/org/forgerock/http/session/SessionContext.html)
