Cookies - Written by Javascript Read by Rails

Is there a way for Rails to read cookies written by a piece ofJavascript
code and read by Rails? – I am integrating a third party software
service which writes a cookie to the user’s browser which contains
routing information. I need to make sure that the Rails app and the
third party app both have the same information, all the time.



On May 21, 2011, at 9:33 AM, Bharat R. wrote:

Sure. Just make sure that your JavaScript is writing the cookie to the
current domain, and you should be able to read it with
cookies[:yourKeyName] where:yourKeyName is the “name” assigned to the
cookie from JavaScript.

IF you haven’t settled on a cookie wrapper, google cookiejar.js for an
elegant solution.