Session variables vs local variables
<p>Whenever I have to store anything in the session, I have picked up the habit of minimizing the number of times I have to access the session by doing something like this:</p>

<pre><code>private List&lt;SearchResult&gt; searchResults;

private List&lt;JobSearchResult&gt; SearchResults
    {
        get
        {
            return searchResults ?? (searchResults = Session["SearchResults"] as List&lt;SearchResult&gt;);
        }

        set
        {
            searchResults = value;
            Session["SearchResults"] = value;
        }
    }
</code></pre>

<p>My reasoning being that if the object is used several times throughout a postback, the object has to be retrieved from the Session less often. However, I have absolutely no idea if this actually helps in terms of performance at all, or is in fact just a waste of time, or perhaps even a bad idea. Does anyone know how computationally expensive constantly pulling an object out of the session would be compared to the above approach? Or if there are any best practices surrounding this?</p>
