2

I have in my web application (asp.net) auto-refresh function that goes to the server and updates the displayed data. Every call (as I read and tested), reset the session timeout and therefore it never ends.

Is there any way to prevent from a specific call to extend the timeout?

Is there any way to check in the background from client-side if the user is still authenticated and if not to redirect him to login page?

I check in every ajax start, and if I get 403 error I redirect him. Can I do it without a real operation from the user?

6
  • Can we see some code and HTML? Commented May 27, 2014 at 12:16
  • Auto Refresh is build from a few ajax calls that gets data from the server (folder list, document list both are sync) and load templates from the server using $get. Commented May 27, 2014 at 12:19
  • Is it MVC or Web Forms? Commented May 27, 2014 at 12:26
  • ASP.NET web app (edited) Commented May 27, 2014 at 12:27
  • Does your query to DB takes so long? then its a problem. I think one solution could be create a separate service asmx or WCF and use that to fetch the data, hopefully that will not reset the session timeouts. Commented May 27, 2014 at 13:29

1 Answer 1

1

I don't know whether this will work or not, but still you can give one try.

I found it on other thread of stack overflow. The idea is it removes the session auth cookie from response, that way it is not refreshed.

// Hide the cookie so this call doesn't extend the user's ticket HttpContext ctx = HttpContext.Current; ctx.Response.Cookies.Remove(FormsAuthentication.FormsCookieName); 

How do I stop ASP.net forms authentication / session from renewing in setInterval ajax web service call?

Sign up to request clarification or add additional context in comments.

1 Comment

Any idea how to not extend session for polling ajax requests when using OWIN authentication

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.