Correct way to deal with potential session expiration
<p>I am wondering what is the best (e.g. most efficient, commonly accepted, industry standard) way to deal with the potential expiration of a session when you are regularly using the values stored in it in your code.</p>

<p>For example, I am often using (in C#) lines similar to the following:</p>

<pre><code>Guid personGuid = (Guid)Session[SSPersonGuid];
</code></pre>

<p>I am checking in Page_Load whether the values are null and dealing accordingly, but the session might expire while the person is on the page, in which case when they click a button on the page, and we need to use something like the above, there will be a NullReferenceException.</p>

<p>Is the best way to handle this just to check for null before each usage like this:</p>

<pre><code>if (Session[SSPersonGuid] == null) {...}
</code></pre>

<p>Or is there some kind of special thing I don't know about?</p>
