This project contains an HTTP Module
and extensions to the HttpRouteCollection
to enable
session in Web API 2.
- Build the solution and add
WebApiSessionEnabledRoutes.dll
as a reference to your Web API 2 projects. - Use
config.Routes.AddHttpSessionRoute()
in your Web API initialization to register session-enabled routes. SetreadOnlySession
tofalse
for routes that only need read access to session; set it totrue
for routes that need read and write access to session. - No registration of the HTTP Module is necessary--IIS will register the module automatically on startup.