I'm running a Rails app on Heroku, and I'm trying to port over all inline Twitter requests (namely oauth authentication) to a Node.js app, because when Twitter is slow, since the Ruby server is blocking, the Twitter requests clog up my app. (My average request takes about 50ms, but my average Twitter Oauth request takes about 1500ms!)
The node.js app and the rails app can access the same database.
What I can't figure out, though, is how to initiate a session with node.js, and then use that session in the rails app. Right now I'm using the default Rails cookie session store.
I'd want it to work something like...
1) user arrives at landing page http://railsapp.com
2) user initiates log-in with http://nodeapp.com/login or http://nodeapplogin.railsapp.com
3) user does the twitter oauth dance with node.js
4) upon successful log in, user is redirected to http://railsapp.com/dashboard WITH an active rails session that can be used throughout the rails app
Any ideas/suggestions?