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

# Account Management

> Access and update player profiles with PlaytoliaSession

`PlaytoliaSession` provides the current player's profile. It syncs automatically after login and on profile changes.

### Getting the current user

```c# theme={null}
User user = PlaytoliaSession.GetUser();
if (user == null) return; // not logged in

Debug.Log(user.Username);
Debug.Log(user.PlayerId);
Debug.Log(user.Email);
```

**User fields:** `Uid`, `PlayerId`, `Username`, `DisplayName`, `Email`, `Avatar` (URL), `Lang`, `Location`, `Timezone`, `CreatedAt`

<Warning>`GetUser()` returns `null` until the player is authenticated.</Warning>

### Listening to session changes

```c# theme={null}
void Start()
{
    PlaytoliaSession.AddListener(OnSessionChanged);
}

void OnSessionChanged()
{
    User user = PlaytoliaSession.GetUser();
    usernameText.text = user?.Username ?? "Guest";
}

void OnDestroy() => PlaytoliaSession.RemoveListener(OnSessionChanged);
```

### Updating profile

```c# theme={null}
PlaytoliaSession.UpdateUsername("newUsername");
PlaytoliaSession.UpdateDisplayName("Display Name");
PlaytoliaSession.UpdatePassword("oldPass", "newPass");
```

<Info>Profile updates are fire-and-forget. Listen to session state changes to confirm the update was applied.</Info>

<CardGroup cols={2}>
  <Card title="Social" icon="users" href="/for-unity/social">Friends and player search</Card>
  <Card title="SDK Reference" icon="code" href="/sdk-reference/session">PlaytoliaSession reference</Card>
</CardGroup>
