开发者

How to load a session by its id in rails?

开发者 https://www.devze.com 2022-12-22 04:28 出处:网络
Im having a hard time trying to figu开发者_StackOverflowre 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 se

Im having a hard time trying to figu开发者_StackOverflowre 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?


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)
0

精彩评论

暂无评论...
验证码 换一张
取 消