How to modify or custom sessionId in spring session project?

a 夏天 提交于 2021-02-16 20:57:44

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!