serializing session object in json string
<p>I built a strongly typed session object that looks like this:</p>

<pre><code>class MySession
{
  public string UsedID {get;set;}
  public List&lt;int&gt; ListOfInt {get;set;}
  public List&lt;string ListOfString {get;set;}
  .....
}
</code></pre>

<p>I'm currently using InProc session so when a page loads, I write:</p>

<pre><code>MySession TheSession = Session["UserSession"] as MySession;
</code></pre>

<p>and then later in the code I can access each property with <code>TheSession.XYZ</code> syntax.</p>

<p>This is really cool but I'm thinking that it might be better to store the session in the DB.</p>

<p>I'm thinking about serializing the MySession object in a json string and store the string in a DB that I can retrieve and deserialize when a page loads.</p>

<p>Is this a good way to do it?</p>

<p>Thanks for your suggestions.</p>
