Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 778497
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T19:46:22+00:00 2026-05-14T19:46:22+00:00

I need to be notified any time a largeish asp.net mvc web application makes

  • 0

I need to be notified any time a largeish asp.net mvc web application makes an ajax call to the server. We’re using both jquery, and the built-in Ajax.* methods to do the remote calls, and I would like a global way of knowing when we make a call without having to manually inject some sort of “IsMakingCall” method to every request.

The root problem we’re trying to solve is session timeout. If the user leaves a page up and goes to lunch (for example), they get errors when they get back because the ajax call is returning the login page instead of the expected json or partial html result.

My idea was to have a js timer which would be reset any time we make an ajax call. That way, if the timer runs out (ie. their session has now timed out) I can just auto-log them out. This is how sites like bank of america and mint.com work.

Thanks!

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T19:46:23+00:00Added an answer on May 14, 2026 at 7:46 pm

    I handle the problem you describe in a different fashion, client-side. I have a jQuery plugin on my master page that will prompt the user to renew their session via a dialog just before it is set to expire. If the user doesn’t respond (or clicks logout), it calls the logout action on the application. If the user “renews” their session, it makes an AJAX call back to the server, resetting the sliding window server-side.

    You can find code on my blog, http://farm-fresh-code.blogspot.com. Right now it doesn’t take account of AJAX actions that may renew the session, but you could instrument it so that jQuery AJAX, via a global ajaxStart would reset the timer. It uses ajaxStart to reset the timer when a jQuery AJAX request is made. I don’t use MS AJAX much so I’m not sure if there’s a global hook you can use. It doesn’t appear so from inspecting the code, but you could manually add one via AjaxOptions to each request. You might investigate adding a handler to the Sys.Net.WebRequestManager, too.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on a stock-standard, ASP.NET MVC 3 web application (hosted on IIS 7).
I need to create a web page (using asp.net MVC2 and possibly WCF) showing
my application, written in Java, need to get notified each time internet connection is
I need to show a reminder as floating popup/alert in my asp.net mvc (C#)
I'm writing web application where I need to push data from server to the
I have a doubt using FileSystemWatcher in C#. I need to be notified when
Some explanation: there are several machines(hosts) that need to be notified about any changes
I'm making an ASP.NET MVC project and i would like to implement business data
I would like to automatically answer ANY incomming call in LYNC. Using the SDK
I need to find a way to be notified when a System.IO.Pipe.NamedPipeServerStream opened in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.