我正在深化發展的web應用程序切換時丟失(JSF 2.0 +小面+ RichFaces的3.3.3 +的Oracle 10g + tomcat的6.0.26)會話從HTTPS到http(Tomcat的6.0.26)
在我的應用,還有就是沒有固定1路,和其他固定(web.xml中):
<login-config>
<auth-method>FORM</auth-method>
<form-login-config>
<form-login-page>/faces/login.jsp</form-login-page>
<form-error-page>/faces/error.jsp</form-error-page>
</form-login-config>
</login-config>
<security-constraint>
<web-resource-collection>
<web-resource-name>Admin_Resource</web-resource-name>
<description/>
<url-pattern>/faces/admin/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>A</role-name>
</auth-constraint>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>
<security-role>
<description>Role admin</description>
<role-name>A</role-name>
</security-role>
所以,這條道路並不安全:/面/客戶/ *。 當我從https TP HTTP動,我用這個函數:
FacesContext.getCurrentInstance().getExternalContext().redirect("http://url/faces/client/page.xhtml");
當我部署我的應用程序,並使用這個網址:HTTP(S):// URL/MyContext /面/ ...,所有工作得很好。當我將我的應用程序移動到ROOT上下文時,所以我使用這個URL:http(s):// url/faces /,當我從https移動到http時,我的https會話丟失,然後返回到https 。我的登錄頁面顯示,所以我需要重新輸入我的登錄名和密碼。
爲什麼我的會話丟失了?有什麼不對 ?
地址:當我部署我的應用程序,這是我做的(外部服務器):
把我的戰爭文件到WebApp文件夾
啓動我的服務器(這將解壓縮我的戰成文件夾,...),然後停止
刪除我的戰爭文件
我更換根文件夾與解壓縮war文件
內容的內容,並重新啓動我的服務器再次
但是當我把我的戰成web應用程序文件夾中的所有工作正常,然後啓動服務器(就這樣)。
所以,我認爲這是一個背景問題。
你有什麼想法嗎?
如果它們是在SSL會話中生成的,tomcat會將其會話cookie標記爲「安全」嗎?這將阻止他們能夠流入非SSL請求。 – 2011-02-17 08:15:32