我想知道为什么第一次访问我的应用程序时cookie会显示在地址栏中?出于安全原因,我想隐藏地址栏中的cookie。
正如您在访问应用程序时从以下文件中看到的那样,首先调用index.html
,然后重定向到home.xhtml
,因为您还没有会话您被重定向到login.jsp
。并非总是如此,但有时您可以在地址栏中看到cookie。
的index.html
<html>
<head>
<meta http-equiv="refresh" content="1;url=faces/content/home.xhtml">
</head>
<body bgcolor="white">
</body>
</html>
的web.xml
<login-config>
<auth-method>FORM</auth-method>
<form-login-config>
<form-login-page>/faces/jsp/login.jsp</form-login-page>
<form-error-page>/faces/jsp/loginretry.jsp</form-error-page>
</form-login-config>
</login-config>