title: Can session call dispose method on session ending time?
body: <p>I want to know if IDisposable objects will dispose on session ending.</p>
  
  <p>I know, I can dispose on Session ending event myself. But I want to write an IDisposable class.</p>
  
  <p>For example, I have</p>
  
  <pre><code>public class MyObject : IDisposable
  {
      // some properties
  
      public void Dispose()
      {
          // disposing
      }
  }
  </code></pre>
  
  <p>and I need to dispose this object on session ending time :</p>
  
  <pre><code>    protected void Session_End(object sender, EventArgs e)
      {
          if (Session["key"] != null)
              ((MyObject)Session["key"]).Dispose();
      }
  </code></pre>
  
  <p>So, I want to know on session ending time that operation will automatically or I need write as above.</p>