SessionMiddleware

Middleware that extracts session data for a request and stores it in the context

SessionMiddleware.swift:25
struct SessionMiddleware<Context> where Context : SessionRequestContext

The SessionMiddleware requires that the request context conform to SessionRequestContext.

The middleware extracts the session data from storage based off the session cookie in the request. If after returning from running the rest of the middleware chain the session data is flagged as being edited it will save it into the session storage and in the case this is a new session will set the “Set-Cookie” header.