Skip to content

Instantly share code, notes, and snippets.

@jjb
Created May 2, 2014 15:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jjb/68b0b6a949d00360aa21 to your computer and use it in GitHub Desktop.
Save jjb/68b0b6a949d00360aa21 to your computer and use it in GitHub Desktop.
How to find a particular user's ActiveRecord session
ActiveRecord::SessionStore::Session.find_each do |session|
if (user_to_find.id == session.data["warden.user.user.key"][0][0] rescue false)
print "[#{session.id}]"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment