SpringSecurity 登录重定向问题

现象

访问  http://172.22.65.1:59324/context,跳转到登录界面,输入用户名密码,form表单提交到: http://172.22.65.1:59324/context/j_spring_security_check,验证通过,重定向到:
Location:
http://172.22.65.1:59324/context
并且设置 session cookie:
Set-Cookie:
JSESSIONID=2B541AC3753C42EA6278DAF3787981C4; Path=/context/; HttpOnly

但是重定向后的地址没有访问该session cookie(Cookie Path不同)的权限,登录失败。

原因

https://bz.apache.org/bugzilla/show_bug.cgi?id=58765

解决方案

1、设置tomcat context参数

This issue can also be corrected by changing the context parameter sessionCookiePathUsesTrailingSlash=false, however this has a potentially negative security impact so I don't think this default should be changed.

2、重定向

如果访问的是:http://172.22.65.1:59324/context 自动重定向到 http://172.22.65.1:59324/context/


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值