Session for each tab in a browswer

1 view
Skip to first unread message

Jeffrey Taylor

unread,
May 12, 2018, 7:11:35 PM5/12/18
to pad...@googlegroups.com
Is there a way, e.g., a plug-in, to have a session per browser tab? Second
best, per browser (e.g., Chrome and Firefox)?

TIA,
Jeffrey

Matthias

unread,
May 13, 2018, 12:11:03 AM5/13/18
to pad...@googlegroups.com
Hi Jeffrey,

I fear that there is not a simple solution (or gem) for your challenge.
One way would be to store session Ids in cookies, but cookies are per
client and not per tab. You can add to each URL some parameter
indicating that this is a session or use the local storage with
JavaScript to generate a random hash for each tab. You could also use
HTML5 sessionstorage
https://www.w3schools.com/html/html5_webstorage.asp. Another way would
to have your own SessionHandler which adds it's id in a custom hidden
field in your application.erb template.

Maybe you can ask some people on twitter or on other mailing lists for
that - maybe there is a hidden gem for that (or you need to write on
your own and help others with that issue as well).

Cheers

Matthias
Reply all
Reply to author
Forward
0 new messages