Life Cycle Hooks
on_logout
Decorator to react to a user logging out. Useful to clear cookies or other user data through the HTTP response.
Parameters
request
fastapi.Request
The request object.
response
fastapi.Response
The response object.
Usage
from fastapi import Request, Response
import chainlit as cl
@cl.on_logout
def main(request: Request, response: Response):
response.delete_cookie("my_cookie")
Was this page helpful?