THE ORIONIS API
Build with clarity.
Explore the building blocks of an async-first Python framework. Every module, class, and method — connected, searchable, and ready to build with.
class documentation
class StartSessionMiddleware(BaseMiddleware): (source)
Constructor: StartSessionMiddleware(manager, catch)
Undocumented
| Static Method | __store |
Record the current URL as the page to redirect back to. |
| Method | __init__ |
Initialise the middleware with the given session manager. |
| Async Method | __response |
Render failures while the session is still available for persistence. |
| Async Method | handle |
Process the request through the session lifecycle. |
| Class Variable | __slots__ |
Undocumented |
| Instance Variable | _catch |
Undocumented |
| Instance Variable | _manager |
Undocumented |
| Instance Variable | _track |
Undocumented |
Record the current URL as the page to redirect back to.
Only GET/HEAD responses with status 200-299 are stored, excluding AJAX and requests that want JSON. Other statuses, background calls and form submissions never overwrite the previous page.
| Parameters | |
request:Request | Incoming HTTP request. |
response:Response | Outgoing HTTP response. |
session:ISession | Active session for this request. |
| Returns | |
None | Undocumented |
Initialise the middleware with the given session manager.
| Parameters | |
manager:SessionManager | Session manager used for the start / save cycle. |
catch:ICatch | Framework exception handler producing responses before persistence. |
| Returns | |
None | Undocumented |
async def handle(self, request:
Request, call_next: Callable[ [], Awaitable[ Response]]) -> Response:
(source)
¶
Process the request through the session lifecycle.
| Parameters | |
request:Request | Incoming HTTP request. |
callCallable[[], Awaitable[Response]] | No-arg async callable that advances to the next middleware or final route handler. |
| Returns | |
Response | The outgoing HTTP response, optionally augmented with a Set-Cookie header when the session was used. |