user2916811
user2916811

Reputation: 11

Rails Session on browser/tab close

I've got an application where a customer can only have one session at any one time. I've got it sorted so this is the case except in one scenario where when a tab or a browser is closed the session cookie is not destroyed. This then lets them log in elsewhere, and then reopen the browser and lets them have multiple sessions running.

If I properly close the browser down then the cookie is removed, but is is possible to remove them without a full closedown of the browser?

The application is already live on a customers site, so I'm hopefully looking for a way to just destroy the cookie rather than re-writing how the whole session storage currently works, though any suggestion is welcome.

Upvotes: 1

Views: 1056

Answers (1)

santiago.doldan
santiago.doldan

Reputation: 1

I know this post is really old, but someone could find this useful, here there is a gem that lets manage a new level of sessions per tab -> https://github.com/santiagodoldan/micro_sessions, I forked from another repo and added support for rails 4.x

Upvotes: 0

Related Questions