---
title: Get Session Data node
description: 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).
component: auth-node-ref
version: latest
page_id: auth-node-ref::get-session-data
canonical_url: https://docs.pingidentity.com/auth-node-ref/latest/get-session-data.html
keywords: ["Nodes &amp; Trees", "Journeys", "Authentication", "Sessions"]
page_aliases: ["auth-node-get-session-data.adoc"]
superseded_by: https://docs.pingidentity.com/auth-node-ref/latest/get-session-data.html
section_ids:
  example: Example
  availability: Availability
  inputs: Inputs
  dependencies: Dependencies
  configuration: Configuration
  outputs: Outputs
  outcomes: Outcomes
  errors: Errors
---

# 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.

Find more information in [Session upgrade](https://docs.pingidentity.com/pingoneaic/am-sessions/session-upgrade.html).

## 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=example,dc=com`                           |
| `Principal`                  | `id=amadmin,ou=user,dc=example,dc=com`        |
| `Principals`                 | `amAdmin`                                     |
| `Service`                    | `ldapService`                                 |
| `successURL`                 | `/am/console`                                 |
| `sun.am.UniversalIdentifier` | `id=amadmin,ou=user,dc=example,dc=com`        |
| `UserId`                     | `amAdmin`                                     |
| `UserProfile`                | `Required`                                    |
| `UserToken`                  | `amAdmin`                                     |
| `webhooks`                   | `myWebHook`                                   |

## 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.
