title: Auto Logout after 15 minutes of inactive c#
body: <p>The below method logouts the user after 15 minutes.But the issue is even if the user is active it will log him out.</p>
  
  <p>I am looking for solution that when user is not <strong>active</strong> for full 15 min the method it will log him out other than that the method will not run.</p>
  
  <pre><code>public void AutoRedirect()
  {
      int int_MilliSecondsTimeOut = (this.Session.Timeout * 900000);
      string str_Script = @"
      &lt;script type='text/javascript'&gt; 
      intervalset = window.setInterval('Redirect()'," + int_MilliSecondsTimeOut.ToString() + @");
      function Redirect()
       {
         alert('Your session has been expired and system redirects to login page now.!\n\n');
         window.location.href='../index.aspx'; 
       }
      &lt;/script&gt;";
      UtilityClass.RemoveCookie("login", Response);
      ClientScript.RegisterClientScriptBlock(this.GetType(), "Redirect", str_Script);
  }
  </code></pre>