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

# on_chat_end

Hook to react to the user websocket disconnection event.

## Usage

```python theme={null}
import chainlit as cl


@cl.on_chat_start
def start():
    print("hello", cl.user_session.get("id"))


@cl.on_chat_end
def end():
    print("goodbye", cl.user_session.get("id"))

```
