如何从我的网址中删除 jsessionid?
我正在使用 Spring Boot MVC (没有 Spring Security;嵌入了 tomcat)。
我读到可以通过将disableUrlRewriting 设置为“true”来完成。
但这看起来像一个 Spring Security 解决方案,我不使用它(这是一个没有登录的简单项目;只有页面;存在会话控制器并且必须是会话控制器)。
我问这个是因为 GoogleBot 正在创建包含 id 的网址。
编辑:
我用以下描述的解决方案解决了这个问题:https://randomcoder.org/articles/jsessionid-considered-harmful
由于这个问题是在 Spring Boot 上下文中,对我来说简单的解决方案是:
server:
session:
tracking-modes: cookie
2年春季之后
server:
servlet
session:
tracking-modes: cookie
添加到 appication.yml 中,它修改嵌入式 tomcat 配置。从 ll spring boot 属性列表中:https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#common-application-properties
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)