title: C# Clear Session
body: <p><strong>Question #1</strong></p>
  
  <p>I want to know when am I supposed to use:</p>
  
  <blockquote>
    <p><a href="http://msdn.microsoft.com/en-us/library/system.web.sessionstate.httpsessionstate.abandon.aspx">Session.Abandon()</a> // When I use this during tracing and after calling it- I find the session still has a value.</p>
  </blockquote>
  
  <p>And  when am I supposed to use :</p>
  
  <blockquote>
    <p><a href="http://msdn.microsoft.com/en-us/library/system.web.sessionstate.httpsessionstate.clear.aspx">Session.Clear()</a></p>
  </blockquote>
  
  <p>When should I use each specific method?</p>
  
  <hr>
  
  <ul>
  <li>In general?</li>
  <li>In my specific case?</li>
  </ul>
  
  <p>I check if session is not equal null in Page Load.  If session is equal to null, I wanna to clear session and redirect to the login page?</p>
  
  <p>Should I use something like this:</p>
  
  <pre><code>private void initSession()
  {
      Session.Clear();
      Session.Abandon();
      Response.Redirect("LoginPage.aspx");
  }
  </code></pre>