---
url: >-
  https://game-engine-io.github.io/enginex-frontend-sdk/reference/api/@getenginex/sdk-vue/functions/useSession.md
---
[Reference](../../../index.md) / [@getenginex/sdk-vue](../index.md) / useSession

# useSession()

> **useSession**(): `Readonly`<`ShallowRef`<[`Session`](../../sdk/interfaces/Session.md)>>

Current player session, reactive to login, logout and a renewal that changes the identity. Subscribes to
`client.session` and undoes the subscription when the component's (or `effectScope`'s) scope ends.
On the server (SSR) it returns the snapshot of the moment, without subscribing.

## Returns

`Readonly`<`ShallowRef`<[`Session`](../../sdk/interfaces/Session.md)>>

Read-only ref with the `Session` of the [EnginexPlugin](../variables/EnginexPlugin.md)'s client.

## Throws

If called in an app without the `EnginexPlugin`.

## Example

```ts
const session = useSession()
const isLoggedIn = computed(() => session.value.status === 'authenticated')
```
