Get session with session_id in Ruby on Rails?
If it is on a different domain (i.e. not a subdomain) there is no way to get session information (because it is stored in a cookie) - you will need something else (see this question ). If it's a subdomain I think there is a neat way to do it automatically by setting the cookie domain (look in environment.rb config.action_controller.session
, try setting :session_domain
)
source to share
It looks like you could use something like:
CGI::Session::ActiveRecordStore::SqlBypass::find_by_session_id(session_id)
However, I'm not sure if this is a good idea or not, in which case it is only useful if you are using ActiveRecordStore. Not sure what else is available in other stores, but if you target under actionpack / lib / action_controller / session / *, you will probably get a more definitive answer.
source to share