AJAX Request Interceptor

This is a little funky script to intercept AJAX requests and raise a simple custom event for everything else in your app to listen to. To use this, you just need to listen for a custom event named `AjaxDetected`. The method, url, and any data is passed in the event detail. document.body.addEventListener(‘AjaxDetected’, function (e) {Continue reading “AJAX Request Interceptor”

Prevent AJAX Requests Making Sessions Infinite in ASP.NET MVC

If you are terminating inactive sessions in your ASP.NET MVC application and you add an AJAX polling call, the chances are you’ll make your sessions last forever thanks to the AJAX request bringing down an updated session cookie. This is because the AJAX call will pull down an updated auth cookie and extend your timeout.Continue reading “Prevent AJAX Requests Making Sessions Infinite in ASP.NET MVC”