开发者

Can a session be shared between browsers from the same computer in rails?

开发者 https://www.devze.com 2023-02-21 00:58 出处:网络
I have a scenario where multiple users开发者_如何学C are using my ruby-on-rails ( rails version 3+ ) app to access xml feeds.

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:

  1. User fetches feed from browser => gets session id "1234"
  2. User opens desktop app
  3. Desktop app requests user to "authorize app" => generate unique token in app "abcd"
  4. Desktop app opens "authorize app url" in browser => `https://x.y/authorize?token=abcd
  5. 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)

0

精彩评论

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