Spring session redis store for multi tenant application

Viewed 155

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 seggregating user session in redis. Please suggest.

1 Answers

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

Related