-
白衣非少年
默认是HttpOnly的,即浏览器关闭便失效。如果你想要修改Cookie,那么请参考如下配置@Beandef securityManager() {def securityManager = new DefaultWebSecurityManager()securityManager.realm = realm()securityManager.cacheManager = cacheManager()securityManager.sessionManager = sessionManager()securityManager.rememberMeManager = rememberMeManager()return securityManager}def sessionManager() {def sessionManager = new DefaultWebSessionManager()def cookie = new SimpleCookie(ShiroHttpSession.DEFAULT_SESSION_ID_NAME)//cookie.setHttpOnly(true)cookie.maxAge = 24 * 60 * 60sessionManager.sessionIdCookie = cookiereturn sessionManager}def rememberMeManager() {def rememberMeManager = new CookieRememberMeManager()def cookie = new SimpleCookie(CookieRememberMeManager.DEFAULT_REMEMBER_ME_COOKIE_NAME)//cookie.setHttpOnly(true)//cookie.setMaxAge(Cookie.ONE_YEAR)cookie.maxAge = 60 * 60 * 24 * 7rememberMeManager.cookie = cookiereturn rememberMeManager}
-
www说
ie11下查看cookie:1:IE11=》F12打开开发人员工具2:开发人员工具=》网络F5启用网络流量捕获3:IE11=》输入和访问相关网址4:开发人员工具=》网络=》详细信息=》Cookie如果你只在java后台写的cookie,前端浏览器当然看不到
-
慕斯709654
因为shiro的登录异常很少,没有设计自定义,不过你可以通过重写异常显示标签来做到:1234567<@shiro.isLoginFailure name="shiroLoginFailure"><!-- isLoginFailure 是判断shiro登录抛出异常的时候 才能进入--> <div class="alert alert-danger" style="background-image: none;"> <@shiro.loginException name="shiroLoginFailure"/> <!-- loginException 是显示具体的异常信息 你可以自己照源码写一个标签来代替--> </div></@shiro.isLoginFailure>