title: Altering Web.Config SessionTimeout value from within application
body: <p>I am trying to work out a way to alter the session timeout dynamically, as my customer has requested that this be a value they can easily change (as though it were a database transaction). Here is a truncated version of the value I am trying to change:</p>
  
  <pre><code>&lt;appSettings&gt;
     &lt;add key="SessionTimeout" value="20"/&gt;
  &lt;/appsettings&gt;
  </code></pre>
  
  <p>I'm working with C#/.Net 3.5 with all of this.</p>
  
  <p>For the record, I am aware that altering the web.config file will cause a restart of the application. What I am going for is to give the administrator of the program the ability to alter the timeout on the fly. If, for example, one of the forms they are requiring people to fill out is taking longer than 20 minutes, and they need to bump the time up to a half hour, or if they want it shortened for some other reason. Since we want to keep the users (including admins) out of the code files, the goal is to create this as part of the site's admin page. </p>
  
  <p>The problem is, I have no idea how to do this, or if it's even possible (much less a good idea). I've given google the run around and come up with nothing.</p>
  
  <p>Is there a way to make these alterations, or even potentially to dynamically change the timeout on the fly (overriding the contents of the web.config)?</p>
  
  <p>Thanks for the help.</p>