Get remaining session time via ajax request without refreshing session

I am writing a session reminder that pops up and counts the session time. The problem is with the client side timer, it is not aware of the session refresh in another browser tab. So I need to check the time with a server side ajax request before showing the popup reminder. In this case, the remaining session time should not be updated.

I am using IIS 8, .NET MVC 4

+3


source to share


1 answer


You can mark your controller as sessionless, maybe this can help you.

Try adding this attribute to your controller class:



[SessionState(SessionStateBehavior.Disabled)]
public class MyController
{
    ....

      

0


source







All Articles