spring-session icon indicating copy to clipboard operation
spring-session copied to clipboard

spring.session.redis.namespace不生效

Open bruceli01 opened this issue 6 years ago • 7 comments

配置了spring.session.redis.namespace,但是服务启动并没有加载此项,而且RedisSessionConfiguration也并未加载。 存入reids中的键依旧是spring:session开头。

Via Google Translate:

Spring.session.redis.namespace is configured, but this item is not loaded when the service starts, and RedisSessionConfiguration is not loaded either. The key stored in reids is still the beginning of spring:session.

image image

bruceli01 avatar Dec 04 '20 09:12 bruceli01

@JustCrazyHeart Could you share details about how you are configuring Spring Session?

I suspect you're using @EnableRedisHttpSession which will result in Spring Boot's auto-configuration backing off. See spring-projects/spring-boot#15757.

vpavic avatar Dec 04 '20 10:12 vpavic

@JustCrazyHeart Could you share details about how you are configuring Spring Session?

I suspect you're using @EnableRedisHttpSession which will result in Spring Boot's auto-configuration backing off. See spring-projects/spring-boot#15757.

使用了@EnableRedisHttpSession

Via Google Translate:

Used @EnableRedisHttpSession

image

bruceli01 avatar Dec 04 '20 11:12 bruceli01

我删除了@EnableRedisHttpSession后,还是没有生效,redis中依旧是spring:session

Via Google Translate:

After I deleted @EnableRedisHttpSession, it still didn’t take effect. The redis still has spring:session

image

image

bruceli01 avatar Dec 04 '20 11:12 bruceli01

Thanks for the update.

From the information you've provided it's hard to figure out why this doesn't work for you. Unfortunately, I cannot reproduce the issue using my own sample. Please provide a minimal sample that we can use to reproduce the problem you're experiencing.

Also note that I've added Google Translate provided translations below your comments. Please try to comment in English in future.

vpavic avatar Dec 06 '20 21:12 vpavic

感谢更新。

根据您提供的信息,很难弄清为什么这对您不起作用。不幸的是,我无法使用自己的样本重现该问题。请提供一个最小的样本,我们可以用来重现您遇到的问题。

另请注意,我已经在您的评论下方添加了Google翻译提供的翻译。以后请尝试用英语发表评论。

Thank you for your reply,My main class has also been added@EnableRedisHttpSession,Today,I deleted the @EnableRedisHttpSession and it takes effect. Thank you again for your reply

bruceli01 avatar Dec 07 '20 05:12 bruceli01

Glad to hear you managed to get it working.

vpavic avatar Dec 07 '20 06:12 vpavic

加个引号就行了

zjg1993 avatar Dec 14 '22 05:12 zjg1993