# `MqttX.Session.ETSStore`
[🔗](https://github.com/cignosystems/mqttx/blob/v0.9.0/lib/mqttx/session/ets_store.ex#L1)

ETS-based in-memory session store.

This is the default session store implementation. Sessions are stored in
an ETS table and persist for the lifetime of the BEAM VM.

## Options

- `:table` - Name of the ETS table (default: `:mqttx_sessions`)

## Usage

    {:ok, client} = MqttX.Client.connect(
      host: "localhost",
      client_id: "my_client",
      clean_session: false,
      session_store: MqttX.Session.ETSStore
    )

    # Or with custom table name
    {:ok, client} = MqttX.Client.connect(
      host: "localhost",
      client_id: "my_client",
      clean_session: false,
      session_store: {MqttX.Session.ETSStore, table: :my_sessions}
    )

## Limitations

- Sessions are lost when the BEAM VM restarts
- Not suitable for distributed deployments (sessions are node-local)

For persistent storage across restarts, implement a custom store using
the `MqttX.Session.Store` behaviour with your preferred database.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
