I have a Tomcat server at port 8080 behind an Apache server at port 80.
I have virtual host setup with mod_rewrite which redirects to Tomcat using the below lines in 000-default.conf:
<VirtualHost *:80>
ProxyPreserveHost Off
ProxyRequests Off
RewriteEngine On
RewriteOptions inherit
ServerName job.nvoids.in
ServerAlias jobs.nvoids.com jobs.nvoids.in www.jobs.nvoids.in
ProxyPass / http://localhost:8080/jobs/
ProxyPassReverse / http://localhost:8080/jobs/
ProxyPassReverseCookieDomain localhost:8080 job.nvoids.in
</VirtualHost>
Now I'm losing all sessions at my Tomcat server.
For example, I retain the sessions with every page load at http://nvoids.in:8080/jobs/post.jsp (you can see the session ID in the page) but unfortunately at http://job.nvoids.in/post.jsp I'm getting a new session every time I reload the page.
How can I retain the session with Apache URL rewrite?