环境
操作系统:
Windows 10 x64
集成开发环境:
Spring Tool Suite 4
Version: 4.12.1.RELEASE
Build Id: 202110260750
浏览器(客户端):
Google Chrome
版本 97.0.4692.71(正式版本) (64 位)
项目结构
参考:Spring Security - 04 使用表单登录认证方式
测试
如果每次测试之前,都要先清除过去一小时的浏览数据,那实在是太麻烦了!
其实,我们可以访问 http://localhost:8080/logout 退出登录,退出登录成功之后,Spring Security 将我们重定向至 http://localhost:8080/login?logout 页面:
参考
Spring Security > Servlet Applications > Authentication > Logout