title: jQuery: Problems cookies internet explorer
body: <p>I have made a login page. When the user logs in a request to an API is send. This API is PHP and checks the username and password. When both are correct an unique key is send back (this is placed in the database for further use: userid and other stuff needed in the website).
  After that key is sent back it is placed in a cookie:</p>
  
  <pre><code>$.cookie("session", JSON.stringify(result));
  </code></pre>
  
  <p>After the cookie is set I send the user to a new page:</p>
  
  <pre><code>location.href = 'dashboard.htm';
  </code></pre>
  
  <p>In this page jQuery checks if the cookie "session" is present. If not, the user is send back to the login page.</p>
  
  <pre><code>sessionId = ($.cookie("session") ? JSON.parse($.cookie("session")).SessionId : 0);
  return sessionId;
  </code></pre>
  
  <p>This works fine in Chrome, but IE (8/9) has some problems with this. I figured out that when you get to dashboard.htm the session is present. As soon as I hit F5 the session is gone. And sometimes the cookie isn't set at all!</p>
  
  <p>I can't seem to figure out why this is happening in IE. Has someone any idea? Other options/ideas to save that unique key are also welcome.</p>
  
  <p>Thanks in advance.</p>