3

We've been working on a spring boot application and the user session management is implemented using redis. Now we are converting the project to use multi tenant model. The problem is users from different tenants are stored under same redisNamespace.

I'm looking for a way to keep the user session isolated for different tenants. Is it possible to configure spring to store session details under dynamic namespace like (redisNamespace + ":" +tenantId + ":"). Or is there any other cleaner way of segregating user session in redis. Please suggest.

ahamdsuhail
  • 103
  • 1
  • 9

1 Answers1

0

You could probably do this using a CacheKeyPrefix, but I have not specifically tried this myself

namizaru
  • 646
  • 3
  • 5
  • hey @namizaru, I guess `CacheKeyPrefix` is relevant to spring-cache. I don't think we can use this for spring-session-redis. Thanks – ahamdsuhail Dec 30 '21 at 06:22