> For the complete documentation index, see [llms.txt](https://xerial.gitbook.io/xerial-doc/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://xerial.gitbook.io/xerial-doc/gaming-toolkit/xerial-unity-sdk-guide/xerial-services/service-managers/session-manager.md).

# Session Manager

The SessionManager class is within the Xerial Unity SDK responsible for managing user sessions. Sessions are essential for maintaining user authentication and authorization states.

The primary purpose of the `SessionManager` is to facilitate the establishment and maintenance of user sessions within Unity applications using the Xerial services. It provides functionality to deserialize session response data received from Xerial servers, allowing the storage and retrieval of user session information.

***

## SessionData Class

The `SessionData` class represents the session information retrieved from the Xerial services. It encapsulates both the access token and the refresh token necessary for maintaining user sessions within Unity applications.

```csharp
public class SessionData
{
    public SessionToken access;
    public SessionToken refresh;
}
```

### Properties

* **access**: An instance of the `SessionToken` class representing the access token associated with the user session.
* **refresh**: An instance of the `SessionToken` class representing the refresh token associated with the user session.

#### Example

```csharp
csharp// Example instantiation of SessionData object
SessionData sessionData = new SessionData();

// Example assignment of access token
sessionData.access = new SessionToken();
sessionData.access.token = "sampleAccessToken";

// Example assignment of refresh token
sessionData.refresh = new SessionToken();
sessionData.refresh.token = "sampleRefreshToken";
```
