> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fermion.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Session ID

> Retrieve the current sandbox session ID, or None if no active session exists using the Python SDK.

The `get_session_id()` method returns the unique **session ID** associated with your active sandbox connection.\
This ID identifies the currently live session linked to your WebSocket connection.

***

### `get_session_id() -> Optional[str]`

**Description:**\
Returns the current sandbox session ID, or `None` if there is no active session.

***

**Parameters:**\
*None*

***

**Returns:**\
`str` or `None` : The session ID if connected, otherwise `None`.

***

**Example**

```python theme={null}
import asyncio
from fermion_sandbox import Sandbox

async def main():
    sandbox = Sandbox(api_key="your-api-key")

    # No active session yet
    print(sandbox.get_session_id())  # None

    # Create a new sandbox
    await sandbox.create(should_backup_filesystem=False)

    # Retrieve the session ID
    print(sandbox.get_session_id())  # e.g. "session-abc123"

asyncio.run(main())
```
