Session Management Middleware
- class falcon_sqla.middleware.Middleware(manager: Manager)
Falcon middleware that can be used with the session manager.
- Parameters:
manager (Manager) – Manager instance to use in this middleware.
- process_request(req: Request, resp: Response) None
Set up a SQLAlchemy session for this request.
The session object is stored as
req.context.session.When the
sticky_bindsoption is set toTrue, areq.context.request_ididentifier is created (if not already present) by calling therequest_id_funcfunction.
- process_response(req: Request, resp: Response, resource: object | None, req_succeeded: bool) None
Clean up the session, if one was provided.
This response hook finalizes the session by calling the manager’s
close_session()method.