restcontroller中的会话id

63lcw9qa  于 2021-07-13  发布在  Java
关注(0)|答案(0)|浏览(245)

在我的 RestController 我在用

RequestContextHolder.getRequestAttributes().getSessionId()

获取会话id。对于来自同一浏览器的不同请求(不同的端点),返回的会话id是不同的。
我需要从ui做些什么来在用户会话的后端使用相同的会话id吗(我正在使用react redux for ui) application.properties :


## Spring DATASOURCE (DataSourceAutoConfiguration & DataSourceProperties)

spring.datasource.url = jdbc:mysql://localhost:3306/some_db?useSSL=false&serverTimezone=UTC&useLegacyDatetimeCode=false&allowPublicKeyRetrieval=true
spring.datasource.username = root
spring.datasource.password = something
spring.datasource.initialization-mode=always

spring.session.store-type=JDBC
spring.session.jdbc.initialize-schema=always
spring.session.timeout.seconds=36000

## Hibernate Properties

# The SQL dialect makes Hibernate generate better SQL for the chosen database

spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5InnoDBDialect

# Hibernate ddl auto (create, create-drop, validate, update)

spring.jpa.hibernate.ddl-auto = update

server.port = 8089

logging.level.root=DEBUG

server.ssl.enabled=true

# The format used for the keystore. It could be set to JKS in case it is a JKS file

server.ssl.key-store-type=PKCS12

# The path to the keystore containing the certificate

server.ssl.key-store=classpath:keystore/xyz.p12

# The password used to generate the certificate

server.ssl.key-store-password=something

# The alias mapped to the certificate

server.ssl.key-alias=something

暂无答案!

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

相关问题