---
title: "open session · RUAL Documentation"
description: "Authenticates the socket with an access token and creates or resumes its session. A RUAL realtime block in the socket group. See its pins and version history."
canonical: https://docs.rual.nl/block-types/realtime/socket_session_open
language: en
---

# open session

This block is part of the [`realtime`](https://docs.rual.nl/block-types/realtime) group and was last modified in core [`v15.0.2`](https://docs.rual.nl/core-versions/150002).

Authenticates the socket with an access token and creates or resumes its session.

- flow

- token `value` required

- resume session `value`

- resume seq `number`

- flags `object`

- contract flags `array` Flags that must match for a resume: client capabilities that change what a replay must hold (a client that rebuilds a feed itself, an envelope version; mssgs's messages_via_catchup).

- device type `value`

- read limit `number` The largest frame the socket accepts, in bytes; 0 keeps the entity's realtime_codec read_limit (default 1 MiB).

- flow

- success `condition`

- refused `value`

- retryable `condition`

- user guid `value`

- session id `value`

- resumed `condition`

- replayed `number`

- error `value`

Called by the blueprint of the socket method that signs a socket in (a HELLO, a LOGIN, mssgs's INIT). Checks the token in process; refused tokens report refused (INVALID, UNAVAILABLE) and retryable. With resume_session and resume_seq it resumes that session when it belongs to the same user, was opened under the same contract_flags, is not held by a live socket, and its rooms' logs still cover the gap: the replay is then written straight after this run's answer, before any live push. Otherwise it opens a new session. Joins user:{guid} and session:{id}.

## Version history

Introduced in [`v15.0.2`](https://docs.rual.nl/core-versions/150002).

- [`v15.0.2`](https://docs.rual.nl/core-versions/150002): block added in this release.

- [Back to `realtime`](https://docs.rual.nl/block-types/realtime): Return to the main group to view all sub-groups

- [Back to `socket`](https://docs.rual.nl/block-types/realtime?group=socket): Return to the group to view all blocks within this group
