title: ASP.NET - Different SessionId across servers when session is stored in SQL Server
body: <p>I manage shared session state across 2 production web servers using SQL Server database.<br />
  Recently I realized (And I am almost sure that this wasn't the case before) that the session is not really shared when jumping from server to server.</p>
  <p>Both servers run the same website on the same domain and are balanced using a hardware load balancer. Both run under IIS7. And in both servers the ASP.NET State Service is running.</p>
  <p>When inspecting the HTTP headers and cross referencing with SQL profiler captures I found what I think might be the problem.</p>
  <p>The SessionId value in my cookies is a 24 character string, e.g: <code>y4hfairc2xbwlupkdsqpv0nz</code></p>
  <p>The SessionID as recieved by the <code>ASPState</code> database and as stored there is longer and has server specific 8 character postfix. e.g. <code>2476b033</code> or <code>2b7731d2</code> which is consistent across all sessions stored in the database.<br />
  The SessionIDs therefore look like: <code>y4hfairc2xbwlupkdsqpv0nz2476b033</code> or <code>y4hfairc2xbwlupkdsqpv0nz2b7731d2</code></p>
  <p>Obviously because of that the session is not shared and each server maintains its own session state.</p>
  <p>Anyone using a similar configuration that might  have encountered this before?</p>
  <p>Thanks</p>
  <h2>update</h2>
  <p>Turns out here: <a href="https://stackoverflow.com/questions/9116100/sessionid-saved-in-sql-server-is-different-from-the-one-generated-from-the-asp-n">SessionId saved in SQL Server is different from the one generated from the asp.net runtime</a> that the extra characters are the IIS AppID. Now I have to find out how to change it so both servers will match. So far no luck.<br />
  Anyone?</p>