title: ASP.NET SessionState with allowCustomSqlDatabase="true" doesn't call specified database
body: <p>The Microsoft documentation here</p>
  
  <p><a href="http://msdn.microsoft.com/en-us/library/h6bb9cz9(v=vs.90).aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/h6bb9cz9(v=vs.90).aspx</a></p>
  
  <p>and several SO articles indicate that specifying <strong>allowCustomSqlDatabase="true"</strong> in the sessionState declaration of an ASP.NET web.config file will allow me to override using the default ASPState database and specify my own database name.</p>
  
  <p>I set these properties in my web.config file.</p>
  
  <pre><code>&lt;sessionState allowCustomSqlDatabase="true" mode="SQLServer" sqlConnectionString="Data Source=mysqlservername;Initial Catalog=DR_ASPState;Integrated Security=true;Connect Timeout=15;" /&gt;
  </code></pre>
  
  <p>When I attempt to bring up the default website page, I get an error message indicating the ASPState database cannot be accessed.</p>
  
  <p>I have monitored the SQL traffic using SQL Profiler and notice that the failure is caused by this request:</p>
  
  <pre><code>SELECT @appId = AppId
  FROM [ASPState].dbo.ASPStateTempApplications
  WHERE AppName = @appName
  </code></pre>
  
  <p>I have recycled the application pools and restarted IIS in an attempt to flush whatever cached database name reference might exist but that does not help. My understanding is that the ASP.NET SessionState would use the database name which I have specified, <strong>DR_ASPState</strong>, to generate the SQL statements which it uses to connect to the SessionState database. But it sure seems like <strong>[ASPState]</strong> is hard-coded into the framework.</p>
  
  <p>Can anybody spot anything which I have done wrong or provide useful troubleshooting information on how to resolve this?</p>