In my Asp.Net MVC application, I want to hide the cart and some buttons if the session is expired.
Here is what I found to do that : How to call function on timer ASP.NET MVC
window.setInterval(function() {
// Send an AJAX request every 5s to poll for changes and update the UI
// example with jquery:
$.get('/foo', function(result) {
// TODO: use the results returned from your controller action
// to update the UI
});
}, 5000);
The question is about the effect of this type of ajax calls on the session. Will an ajax call like this extend the session or as it is not an user action, the session will expire at the end ?