问题
My project use Spring Boot and Spring Session,now i want to modify or custom sessionId before session data persistence in redis,How should I do? thanks!
回答1:
Maybe you need to go through the docs Spring Session works well with spring boot
Docs :http://docs.spring.io/spring-session/docs/current/reference/html5/
It will tell you that coupling the custom implementation with @EnableSpringHttpSession
support allow to easily reuse existing Spring Session configuration facilities and infrastructure.
The tenth chapter 10. Custom SessionRepository will tell what you want.
回答2:
Spring Session currently does not provide a way to specify custom session id generation strategy, so unfortunately the only way to do this at the moment is indeed to provide a custom SessionRepository
implementation.
We do however have an existing ticket in our issue tracker for this, so please vote if you'd like to see this prioritized.
来源:https://stackoverflow.com/questions/48353967/how-to-modify-or-custom-sessionid-in-spring-session-project