How to implement global.asax events by OWIN
<p>from asp.net 6 there would be no file called global.asax but global.asax has many events like</p>

<p>·         Application_Init</p>

<p>·         Application_Start</p>

<p>·         Session_Start</p>

<p>·         Application_BeginRequest</p>

<p>·         Application_EndRequest</p>

<p>·         Application_AuthenticateRequest</p>

<p>·         Application_Error</p>

<p>·         Session_End</p>

<p>·         Application_End</p>

<p>say for example i often work with <code>Application_BeginRequest</code> event to redirect user. here is a sample code</p>

<pre><code>protected void Application_BeginRequest(Object sender, EventArgs e)
{
            if (HttpContext.Current.Request.Url.ToString().ToLower().Contains("content.aspx?content=gm-mdi-diagnostic-tool"))
            {
                Response.RedirectPermanent("http://shop.bba-reman.com/product-category/diagnostic-tools/oem-diagnostic-tools/", true);
            }
            else if (HttpContext.Current.Request.Url.ToString().ToLower().Contains("content.aspx?content=landrover_rover_t4_testbook_lite_diagnostic_tool_ids"))
            {
                Response.RedirectPermanent("http://shop.bba-reman.com/shop/oem-diagnostic-tools/land-rover-t4-mobile/", true);
            }
            else if (HttpContext.Current.Request.Url.ToString().ToLower().Contains("content.aspx?content=ford_ids_main_dealer_tool_mazda_jaguar_landrover"))
            {
                Response.RedirectPermanent("http://shop.bba-reman.com/product-category/diagnostic-tools/oem-diagnostic-tools/", true);
            }
            else if (HttpContext.Current.Request.Url.ToString().ToLower().Contains("content=coda_fuelling_tester_dynamically_measure_fuel_flow_and_pressure_in_situ_under_load"))
            {
                Response.RedirectPermanent("http://shop.bba-reman.com/product-category/diagnostic-tools/", true);
            }
}            
</code></pre>

<p>so tell me how to do the same with OWIN ? discuss with code sample.</p>

<p>also tell me how to capture <code>session start / end or application start or end</code> from <code>OWIN class code</code> ?</p>

<p>please discuss thanks</p>