如何将zuul2的会话存储到redis而不是cookies?

7vhp5slm  于 2021-07-06  发布在  Java
关注(0)|答案(0)|浏览(288)

在zuul1中,我们可以通过spring会话管理会话。而且只需在application.yml中设置即可简单快速地更改会话存储:

  1. spring:
  2. session:
  3. store-type: redis

并在pom.xml中添加:

  1. <dependency>
  2. <groupId>org.springframework.session</groupId>
  3. <artifactId>spring-session-core</artifactId>
  4. </dependency>
  5. <dependency>
  6. <groupId>org.springframework.session</groupId>
  7. <artifactId>spring-session-data-redis</artifactId>
  8. </dependency>
  9. <dependency>
  10. <groupId>org.springframework.boot</groupId>
  11. <artifactId>spring-boot-starter-data-redis</artifactId>
  12. </dependency>

但是如何将zuul2中的会话存储改为redis而不是cookies呢?

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题