Asp.net website loses session on changing client url
<p>I have an asp.net website running on IIS7 and have been having an issue with some users from a university suddenly losing their session. The one thing all these instances have in common is that the user's client url/host address, that they are accessing our website from, changes half way through their session. To be clear, this is what I am recording on their page access:</p>

<pre><code>Request.UserHostAddress.ToString()
</code></pre>

<p>Session state is tracked using the standard asp.net cookie. The relevant line in web.config:</p>

<pre><code>&lt;sessionState mode="InProc" timeout="40"/&gt;
</code></pre>

<p>The website doesn't use frames, and is run from a single server (i.e. not a web farm) using a single worker process (i.e. no web gardening). It only occurs periodically to a single user while other user's sessions remain open at the same time. </p>

<p>I've added cookies to the list of things to be logged for the site as per <a href="https://blogs.msdn.microsoft.com/amenon/2007/08/21/troubleshooting-session-loss/" rel="nofollow">this article on troubleshooting Session loss</a>. A couple of questions:</p>

<ol>
<li>Is it possible that it is the university that is dropping the session cookies and our server isn't even receiving them? And if so, would enabling the logging of cookies pick this up?</li>
<li>Is it possible that IIS drops the cookies if they don't match the previous url associated with it?</li>
</ol>