Disallowing multiple login by same user using different browsers


I need to create an app where one user cannot login using multiple
browsers. As soon as he does, the previous one logs out.

I have a user table with a field named "current_sign_in_token’ to store
session key generated by one login.
But I am not able to retrieve the session key. Actually I don’t know
exactly how to do it. Have been following several posts but in vain.

Following is my initializers/session_store.rb file

Contactapp::Application.config.session_store :cookie_store,{ :key =>

:secret =>


:expire_after => 5.minutes}

I am trying to retrieve request.session_options[:id] in my controller
it doesn’t returns any value. But it does returns values when I use it
in a

The value Rails.application.config.session_options[:key] doesn’t seems
satisfy what I need to do as it just returns the values

What shall I do next. Am stuck.