# libtmux.Session.from_session_id

- **Module:** libtmux.Session
- **Package:** libtmux
- **Language:** Python
- **Kind:** method
- **Source:** https://github.com/tmux-python/libtmux/blob/036c521c4b83ce6e434eb50afe2a0d08a6a05e46/src/libtmux/session.py#L168
- **Page:** https://libtmux.org/reference/py/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 ...)
```
