title: Deserialize javascript associative array into C# Dictionary with Json.Net
body: <p>I used <code>JSON.stringify()</code> to store a javascript associative array of integer keys with boolean values in a cookie e.g. <code>var arr = {}; arr[9000001] = True;</code>.  I can see the value of the string on the server in the following format: <code>%7B%229000001%22%3Atrue%2C%229000003%22%3Atrue%2C%229000006%22%3Atrue%2C%229000009%22%3Atrue%7D</code> where the first number is 9000001, second is 9000003, and so on.</p>
  
  <p>I would like to use <a href="http://json.codeplex.com/" rel="nofollow">Json.Net</a> to deserialize into a <code>Dictionary&lt;long,bool&gt;</code> or similar.  I try the following</p>
  
  <pre><code>var result = JsonConvert.DeserializeObject&lt;Dictionary&lt;string, string&gt;&gt;(cookieValue);
  </code></pre>
  
  <p>but get the following exception</p>
  
  <pre><code>{"Unexpected character encountered while parsing value: %. Path '', line 0, position 0."}
  </code></pre>
  
  <p>I'm guessing deserialization is not possible in this scenario?</p>