Mobile app version of vmapp.org
Login or Join
Gloria169

: Apache server not able to read cookies from Browser I have developed a login authentication page using cookies (with spring security) where for the first time, the user will need to get itself

@Gloria169

Posted in: #Apache2 #Cookie #HttpdConf #Redirects #Virtualhost

I have developed a login authentication page using cookies (with spring security) where for the first time, the user will need to get itself authenticated. Once the user gets successfully authenticated, then on each subsequent request from the same browser, the user will redirected to the success page. The code is working fine on

localhost:8080


but the problem is I have configured Apache HTTP server and when I hit the request through the Apache server to the application, then I think the cookies are not been read by the Apache server.

I have enabled the cookies in httpd.conf file (but it is not working) as well by

LoadModule usertrack_module modules/mod_usertrack.so


and

<VirtualHost *>
ServerName localhost
CookieTracking on
ProxyPass / localhost:8080/stackoverflow/ </VirtualHost>


Please let me know what am I doing wrong

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Gloria169

1 Comments

Sorted by latest first Latest Oldest Best

 

@BetL925

Your server on localhost is most likely writing the cookies for localhost, or for the stackoverflow directory. When it is accessed from behind a reverse proxy, it needs to recognize this and set the cookies the correct domain name.

Instead of the smarts for this residing in the web app on port 8080, you could have the reverse proxy translate the cookies:

ProxyPassReverseCookiePath /stackoverflow /
ProxyPassReverseCookieDomain localhost example.com


See this question on StackOverflow where I asked about jsessionid cookies and used this technique on the reverse proxy to solve my problem.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme