title: Rails not sending session cookies to JSON request
body: <p>I am using Rails 3.2.8. I want to access a record from the application do some processing and return the results in the form of a modified record. I am doing this through json requests to the controller. It is working properly, but I get CSRF warnings when I post the update (of course). I thought to remove these by storing the session cookie from the original request and using when doing the post. (This also seems like a good security practice). </p>
  
  <p>The problem is that a session cookie is not being sent. I have tried using HTTParty and RestClient gems. When I make the request in the browser (using RESTClient plugin for firefox) the cookies are sent. I presume that this is the expected behavior as cookies ought to be sent to browsers.</p>
  
  <p>Is there a way to get the cookie to be sent to a script?</p>
  
  <p>Is it correct to do so? and if not how should I be approaching this?</p>