1

I want to access the session of a user from a different domain than the one that I initiated the session. Can I use session.session_id of the user and then retrieve the session hash of that user ?

Thank you

salt.racer
  • 21,903
  • 14
  • 44
  • 51
PanosJee
  • 3,866
  • 6
  • 36
  • 49

2 Answers2

2

If it's on a different domain (i.e., not a subdomain), there's no way to get the session info (cause it's stored in a cookie)—you'll need something else (see this question). If it's a subdomain, I think there's a neat way to do it automatically by setting the cookie's domain (look in environment.rb's config.action_controller.session, try setting :session_domain)

Community
  • 1
  • 1
zenazn
  • 14,295
  • 2
  • 36
  • 26
-1

It looks like you could use something like:

CGI::Session::ActiveRecordStore::SqlBypass::find_by_session_id(session_id)

However, I'm not sure if that's a good idea or not -- and in this case it is only useful if you're using the ActiveRecordStore. Not sure what else is available on the other stores, but if you poke around under actionpack/lib/action_controller/session/* you'll probably get a more definitive answer.

gabrielhilal
  • 10,660
  • 6
  • 54
  • 81
sammich
  • 335
  • 5
  • 13
  • 19