title: Why asp.net session is expired sooner than its timeout?
body: <p>I have an Asp.net webservice. It has method M1. M1 creates a folder for each session. When a session is expired, I delete that folder in global.asax using the following code.</p>
  
  <pre><code>void Session_End(object sender, EventArgs e)
      {
          try
          {
              System.IO.DirectoryInfo dirMyPacksFolder = new System.IO.DirectoryInfo(Utilities.getMyPacksFolder(Session));
              //dirMyPacksFolder.Parent.CreateSubdirectory("ended_" + Session.SessionID);
              if (dirMyPacksFolder.Exists)
              {
                  dirMyPacksFolder.Delete(true);
              }
          }
          catch (Exception ex)
          {
              Utilities.logException("", ex);
          }
      }
  </code></pre>
  
  <p>When I open my webservice in browser and call M1, it operates correctly and the folder is deleted on timeout expiration time that I have set. But when I submit "Invoke" button of webservice for the second time (after session timeout and folder is deleted), its session <strong>starts</strong> (create folder) and <strong>ends</strong> (deletes folder) <strong>immediately before timeout that I have set.</strong></p>
  
  <p><strong>Why this happens?</strong></p>
  
  <p>If I open a new window (new session) for each method call everything is OK. But I have problem when I click "Invoke" button for second time. It is something like caching problem for same sessions.</p>