I have a Java Web project,
Nginx as the http proxy,
Tomcat as the back-end Servlet Container.
An app that deployed on the Tomcat has a Context Path and it runs like http://localhost:8080/project-name
I show that project to the users like this: http://www.project-name.com
with: proxy_pass http://localhost:8080/project-name/
I’m using a session in the Java Web project and that session is handled by a cookie sent with the name JSESSIONID.
The problem is JSESSIONID has a cookie path with /project-name/ and the browser can’t access that because the user is NOT browsing http://www.project-name.com/project-name/
Do you know what is the best practice here to get over this problem?
http://tomcat.apache.org/tomcat-6.0-doc/config/context.html
Look for
sessionCookieDomain,sessionCookieNameandsessionCookiePath.