Is there a way for Rails to read cookies written by a Javascript 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.
Is there a way for Rails to read cookies written by a Javascript 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.
Thanks.
Bharat
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.