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