title: Session retaining stale values when using Angular $http.post?
body: <p>From what I have been seeing in my app, if I my controller using an AngularJs $http.get request, I can't update session data in the controller that handles this request because a render :json=> data type response doesn't update the session cookie on the client. I'm not sure that is actually true, but that what seems to be happening.   </p>
  
  <p>If it is true though it seems like if I use devise, for example, and initialize a a session variable, e.g. session[:foo]="bar" in session#create, and then subsequently I have an angular module which executes a $http.get, which is handled by, say, account#my_method, as follows</p>
  
  <pre><code>def my_method
        session[:foo]="baz"
        [do something]
        render :json =&gt; {status: "OK"}
  end
  </code></pre>
  
  <p>the session[:foo] change will not be persisted in the user's session cookie thus the next time the user hits a controller session[:foo] will still equal "bar", not "baz".</p>
  
  <p>It seems unlikely, but that looks like what I'm seeing as I debug my application.    If so would using a database or memcache session store work better, since the change would happen server side and would not require updating the client side cookie?   Or is there a way to handle session updates when using Ajax type methods like $http.get in AngularJs</p>