views:

80

answers:

2

Im having a hard time trying to figure out how to load a session by its id. I don't want the current_user session, I need to load another one (mostly because flash doesnt share sessions with the browser). So I'm passing the session_id forward with the parameters, how do I get the session in the other side? Authlogic is redirecting me to login page aways...

I'm usign mem_cached_store to store the sessions. But I'm looking for something 'find_by_id', any idea?

A: 

I wouldn't call this spam, but I wrote about something very similar on my blog a few months back.

vise
A: 

if you have the session id, you can pull the session out of memcached with the session id prefixed with "session:".

session_key = "session:#{session_id}"
mcache = MemCache.new('localhost')
user_session = mcache.get(session_key)
Kevin