I have an application based on eXist-db. It's basically a Java web application that uses Jetty. It runs on the remote Linux server behind Apache proxy.
I use the following Apache configuration:
ServerName domain.com
ProxyRequests off
ProxyPass /myapp http://localhost:8899/exist/apps/myapp
ProxyPassReverse /myapp http://localhost:8899/exist/apps/myapp
Everything works fine except the sessions. On each request the session is renewed. It means the request Cookie header does not contain JSESSIONID
but the response Set-Cookie header is something like JSESSIONID=oryq5odyt3f79xxax25n7x0h;Path=/exist
. Also I check the session id in the application that confirms the session is new every time.
I've tried three testing scenarios:
Testing scenario A:
- Client: Windows 7, Google Chrome
- Server: Ubuntu 12.04.4 LTS (GNU/Linux 3.11.0-26-generic x86_64), proxy Apache/2.4.9
Testing scenario B:
- Client: Windows 7, Google Chrome
- Server: CentOS release 6.6 (Final), proxy Apache/2.2.15
Testing scenario C (local):
- Client: Windows 7, Google Chrome
- Server (the same laptop): Windows 7, no proxy
The issue appears in both scenarios A and B but not in C.
Any ideas how to make sessions work?