title: finding session state tag in web.config
body: <p>I need to write a function, where I have to find session state tag/setting in web.config of an application.</p>
  
  <p>I will be passing <code>web.config</code> file as a parameter to this function and function should detect the tag and delete it, then should return <code>web.config</code> without session state tag in it.</p>
  
  <p>Can I have some functionality or regex to achieve this?</p>
  
  <p>Session tag format: </p>
  
  <pre><code>&lt;sessionState mode="StateServer" stateConnectionString="tcpip=CTSINTCOVOCPRD4:42424" /&gt;
  </code></pre>
  
  <p>or</p>
  
  <pre><code>&lt;sessionState mode="StateServer" stateConnectionString="tcpip=CTSINTCOVOCPRD4:42424"&gt;&lt;/sessionState&gt;
  </code></pre>