# libtmux.Session.from_session_id

- **Module:** libtmux
- **Package:** libtmux
- **Language:** Python
- **Kind:** method
- **Source:** https://github.com/tmux-python/libtmux/blob/38e368c11117fb4aeb2f082d552cd4f210eae06a/src/libtmux/session.py#L153
- **Page:** https://libtmux.org/en/py/stable/reference/libtmux-session-from_session_id/

```
libtmux.Session.from_session_id(
    cls, server: Server, session_id: str
) -> Session
```

Create Session from existing session_id.

## Examples

```python
>>> Session.from_session_id(
...     server=session.server, session_id=session.session_id
... )
Session($1 ...)
```

## Parameters

- `server` (`Server`): The tmux server holding the session.
- `session_id` (`str`): Session id, e.g. ``"$1"``.

## Returns

:class:`Session`

## Raises

- [`TmuxObjectDoesNotExist`](/en/py/stable/reference/libtmux-exc-tmuxobjectdoesnotexist/): When no such session exists on a reachable server.
