Legend

Class
Struct
Enum
Interface
Delegate
Constructor
Method
Property
Event
Field

Method: HttpResponse Handle(HttpRequest, Func<HttpResponse>)

Declaration

public HttpResponse Handle(
    HttpRequest req,
    Func<HttpResponse> handler
)

Summary

Retrieves the session ID from the session cookie (specified by the cookie name) from the given HttpRequest and calls the handler function. A session cookie is added to the HTTP response returned by the handler only if either SimpleSession.DeleteSession() or SimpleSession.NewSession(string, DateTime?, string) have been called (possibly by the handler). Before the possibly augmented HTTP response is returned, the status of DeleteSession and NewSession is reset.

Parameters

HttpRequestreq The current HTTP request.
Func<HttpResponse>handler The inner request handler to execute.

Returns

An HTTP response, possibly augmented with a session cookie.