Can a session be shared between browsers from the same computer in rails?
I have a scenario where multiple users开发者_如何学C are using my ruby-on-rails ( rails version 3+ ) app to access xml feeds.
These feeds need to different for each user session, but if a user was to access the feed from his browser or from a desktop application that pulls those feeds, the session needs to remain the same.
I cannot designate sessions based on IP addresses, because sometimes multiple users will have the same IP.
Is there a way to to share the sessions that come from the same computer in rails?
How about doing something like:
- User fetches feed from browser => gets session id
"1234"
- User opens desktop app
- Desktop app requests user to "authorize app" => generate unique token in app
"abcd"
- Desktop app opens "authorize app url" in browser => `https://x.y/authorize?token=abcd
- Rails app then gets 1. current session & 2. the token
I can imagine only IP solution or you can try to find out MAC address and store it for each user (encrypted)
精彩评论