---
title: Get Session Data node
description: "Retrieves a value from a user's existing session by key and stores it in the shared node state, for use during session upgrade journeys."
component: platform
version: 7.5
page_id: platform:auth-node-ref:get-session-data
canonical_url: https://docs.pingidentity.com/platform/7.5/auth-node-ref/get-session-data.html
llms_txt: https://docs.pingidentity.com/platform/llms.txt
docs_for_agents: https://developer.pingidentity.com/build-with-ai/docs-for-agents.md
keywords: ["Nodes &amp; Trees", "Journeys", "Authentication", "Sessions"]
page_aliases: ["auth-node-get-session-data.adoc"]
section_ids:
  availability: Availability
  inputs: Inputs
  dependencies: Dependencies
  configuration: Configuration
  outputs: Outputs
  outcomes: Outcomes
  errors: Errors
  example: Example
---

# Get Session Data node

The Get Session Data node retrieves the value of a specified key from a user's session data, and stores it in the specified key of the shared state (in scripts, the `nodeState` object).

Use this node only during session upgrade—​when the user has already successfully authenticated previously and is now upgrading their session for additional access. Learn more in [Session upgrade](https://docs.pingidentity.com/pingam/7.5/am-sessions/session-upgrade.html).

## Availability

| Product                               | Available? |
| ------------------------------------- | ---------- |
| PingOne Advanced Identity Cloud       | Yes        |
| PingAM (self-managed)                 | Yes        |
| Ping Identity Platform (self-managed) | Yes        |

## Inputs

This node reads values from the user's session data.

## Dependencies

This node can complete its function only when the user has an existing session. Precede this node in the flow with a [Scripted Decision node](scripted-decision.html) using a script to determine whether an existing session is present:

```javascript
if (typeof existingSession !== 'undefined') {
  outcome = "hasSession";
} else {
  outcome = "noSession";
}
```

## Configuration

All the configuration properties are required:

| Property         | Usage                                                                                  |
| ---------------- | -------------------------------------------------------------------------------------- |
| Session Data Key | Specify the session data key whose value the node reads.Default: none                  |
| Shared State Key | Specify the name of the shared node state field to hold the session data.Default: none |

## Outputs

This node writes the Session Data Key value in the Shared State Key field of the shared node state.

It also writes the field and its value to the `objectAttributes` object in the shared node state.

## Outcomes

Single outcome path; on success, the Shared State Key in the shared node state holds the session data.

## Errors

If it cannot read the Session Data Key value, this node logs an `Exception occurred trying to get data (<session-data-key>) from existing session` error message.

## Example

When the user has an active session, the following example gets the username from the session, collects the password, and confirms the username-password credentials:

![Scripted node to check for a session at the start of the flow](_images/trees-node-get-session-data-example-platform.png)

The following table includes example keys from an existing session with their corresponding sample values:

| Key                          | Sample value                                          |
| ---------------------------- | ----------------------------------------------------- |
| `AMCtxId`                    | `e370cca2-02d6-41f9-a244-2b107206bd2a-122934`         |
| `amlbcookie`                 | `01`                                                  |
| `authInstant`                | `2023-04-04T09:19:05Z`                                |
| `AuthLevel`                  | `0`                                                   |
| `CharSet`                    | `UTF-8`                                               |
| `clientType`                 | `genericHTML`                                         |
| `FullLoginURL`               | `/am/XUI/?realm=alpha#login/`                         |
| `Host`                       | `34.117.172.39`                                       |
| `HostName`                   | `am.forgeblocks.com`                                  |
| `Locale`                     | `en_US`                                               |
| `Organization`               | `dc=openam,dc=forgerock,dc=org`                       |
| `Principal`                  | `uid=amAdmin,ou=People,dc=openam,dc=forgerock,dc=org` |
| `Principals`                 | `amAdmin`                                             |
| `Service`                    | `ldapService`                                         |
| `successURL`                 | `/openam/console`                                     |
| `sun.am.UniversalIdentifier` | `uid=amAdmin,ou=People,dc=openam,dc=forgerock,dc=org` |
| `UserId`                     | `amAdmin`                                             |
| `UserProfile`                | `Required`                                            |
| `UserToken`                  | `amAdmin`                                             |
| `webhooks`                   | `myWebHook`                                           |
