Quantcast
Channel: Active questions tagged redis+ruby-on-rails - Stack Overflow
Viewing all articles
Browse latest Browse all 873

How/Where does Devise/Warden generate the cache key used to store a session in Redis?

$
0
0

In my Rails application using Devise and Redis, I can call these things and get a session's ID:

# app/controllers/some_controller.rbsession.idsession[:session_id]cookies['session_cookie']

The value returned for all of the above matches, and - as an example - let's say it's aaaabbbbccccdddd1111222233334444.

While that is happening in the app, I can run the console and get the cache key for the session:

# in the Rails consoleredis = Redis.newredis.keys

What shows up there looks nothing like the ID from before. It's something more like _session_id::2::984375urehgiuhfhe754w9873987e98trieydfijdoewsdjfh948570398408esf.

The question(s) is(are):

  1. How/When/Where does Devise (or is it Warden?) generate the cache key?
  2. How is the cache key related to the Session ID?
  3. Is there a way for a Rails controller to access or programmatically arrive at the session's corresponding cache key?

Viewing all articles
Browse latest Browse all 873

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>