title: logout user when the session time out
body: <p>Can this is the right way to log user out when the session timeout.
  this is the code which i have written in Page_init of master page.
  and also,<br>
  session state and Form Authentication is like,</p>
  
  <pre><code>&lt;sessionState mode="InProc" timeout="1" cookieless="false"&gt;
      &lt;/sessionState&gt;
  
        &lt;authentication mode="Forms"&gt;
            &lt;forms loginUrl="Default.aspx" timeout="2880"/&gt;
          &lt;/authentication&gt;
  
  
      if (userToLogin != null)
                  {
                      if (Context.Session != null)
                      {
                          if (Session.IsNewSession)
                          {
                            HttpCookie newSessionIdCookie = Request.Cookies["ASP.NET_SessionId"];
                              if (newSessionIdCookie != null)
                              {
                                  string newSessionIdCookieValue = newSessionIdCookie.Value;
  
                                  if (newSessionIdCookieValue != string.Empty)
                                  {
                                      **System.Web.Security.FormsAuthentication.SignOut();**                                
                                      Response.Redirect("SessionTimeOutPage.htm");
                                  }
                              }
                          }
                      }
  
                  }
  </code></pre>
  
  <p>please suggest me this is right way or something is available as optimal solution.</p>