title: Setting cookies when using Ajax and JSON
body: <p>Looking for an accepted practice for setting browser cookies within a JSON and Ajax based web application.</p>
  
  <p>The browser seems to not accept cookies from the server for JSON requests. This leaves me with two options that I can see:</p>
  
  <ol>
  <li>When doing operations that need to involve cookies, do not use JSON requests, but rather evaluate the JSON after the text gets to the client using <code>JSON.parse()</code></li>
  <li>Send the cookie information from the server to the client via JSON, then use the browser to set the cookie instead of through server heads. Does this also mean that the cookie information will have to be read on the client and sent back to the server via JSON because the browser will not send cookie information via AJAX JSON requests as well?</li>
  </ol>
  
  <p>My inclination is to go with option #1, but these both seem pretty crappy options. Am I missing something here?</p>
  
  <p>Thanks! </p>