# libtmux.Session.from_session_id

- **Module:** libtmux.Session
- **Package:** libtmux
- **Language:** Python
- **Kind:** method
- **Source:** https://github.com/tmux-python/libtmux/blob/9fdd083a8181a827889337b63cd4e6daea661a8c/src/libtmux/session.py#L168
- **Page:** https://libtmux.org/en/py/latest/reference/libtmux-session-from_session_id/

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

Create Session from existing session_id.

## Parameters

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

## Returns

:class:`Session`

## Raises

- `TmuxObjectDoesNotExist`: When no such session exists on a reachable server.

## Example

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