About TOMCAT7 Services The following JS cannot get Jsessionid cookie information

Source: Internet
Author: User

Http://tomcat.apache.org/tomcat-5.5-doc/config/context.html

Does anyone know what changed in the configuration between Tomcat 6 and Tomcat 7 then would cause the JSESSIONID cookie to not Be accessible via JavaScript?

Using Tomcat 6:

alert(document.cookie); // JSESSIONID=8675309ABCDEF...

Using Tomcat 7:

alert(document.cookie); // nothing



the answer as follow:

Okay, I found the answer. useHttpOnly false The attribute was set to by default in Tomcat 6, and are in true Tomcat 7. This attribute are set for the <Context> container.

<Context useHttpOnly="false" [...] />

For more information about updating from Tomcat 6 to 7:migrating from 6.0.x to 7.0.x

I ' m not sure why I didn ' t see it in the docs before, but I ' ve verified that setting this to false does in fact cause Tom Cat 7 to revert to the Tomcat 6 behavior.



About TOMCAT7 Services The following JS cannot get Jsessionid cookie information

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.