Sharing session data between Rails and Node?

The main question is: Can I read Rails session data in Node?

More details:

I have a project that is written in Ruby on Rails. It works but I want to add to it and eventually replace it using NodeJS. Both are running on the same server, just on different ports.

As of now RoR will serve up all the HTML files (and continue handeling the existing functionality) and then I'll connect to the Node server via AJAX. Node will just dish up JSON for the time being.

The problem is, how can I work with session variables between the two? More specifically, can I get to RoRs session variables in Node? Mostly I just need to know which user is logged in.

If it matters, I am running Rails 2.3.5, Ruby 1.8.7, and Node 0.8.17.

I haven't tried exactly same stuff, myself, but, we did something similar but with Sinatra and Java.

I wouldn't comment about your approach on application design, but, in case you don't mind using Memcached session store in your rails application, yes it is possible. Configuring Memcached with Ruby app is explained on Heroku Doc

In Node application you can use Memcached Client like 3rd-Eden and access session variable from memcache

You would have to explicitly pass session id generated by rails to Node.