title: How can we read or get session timeout with jquery from web.config so that we can handle session expiry in mvc
body: <p>How to get Session Value from webconfig through ajax call</p>
  
  <p>I have tried the following code </p>
  
  <pre><code>&lt;script language="javascript" type="text/javascript"&gt;
         var sessionTimeoutWarning = 
      "&lt;%= System.Configuration.ConfigurationSettings.AppSettings
      ["SessionWarning"].ToString()%&gt;";
          var sessionTimeout = "&lt;%= Session.Timeout %&gt;";
  
          var sTimeout = parseInt(sessionTimeoutWarning) * 60 * 1000;
          setTimeout('SessionWarning()', sTimeout);
  
          function SessionWarning() {
  var message = "Your session will expire in another " + 
      (parseInt(sessionTimeout) - parseInt(sessionTimeoutWarning)) + 
      " mins! Please Save the data before the session expires";
  alert(message);
          }
  &lt;/script&gt;
  </code></pre>