Hashing Cookies in Redis (Spring)
Hello! I'm looking into Spring Session /w Redis for Persistent HTTP Sessions, however when testing locally I'm seeing that the HTTP Session ID is stored in the Redis Cache, and Spring Default Cookie appears to be a base64 encoded string of that Session ID.
Is there a way for me to Hash the ID before it's put in? That way if our Redis Cache leaks, we don't allow hackers to steal cookies? (We could IP check, but I'd rather do both tbh, instead of just one)
Ideally with a Spring Property, or a simple Spring bean would be best.
7 Replies
⌛
This post has been reserved for your question.
Hey @Crain! Please useTIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here./close
or theClose Post
button above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
Hmm, maybe then it might be better to do partial integration, so instead of Spring Session /w Redis, integration as part of the Session Chain.
Pseudo Flow
It does increase the complexity, but the main idea is that when we swap the users to different JVMs the session persists, and it avoids redis being able to leak cookies, since we're just storing an indirect hash.
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
💤
Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived. If your question was not answered yet, feel free to re-open this post or create a new one.
Sounds good
Post Closed
This post has been closed by <@190262684082503680>.