You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Edwin Walsh <ed...@esat.kuleuven.be> on 2008/01/16 14:45:38 UTC

setting cookie and ProxyPassReverse

Hi,

One of our web applications is set up to have people agree to a license 
agreement before using our site. This is done by setting up a cookie 
that tells our browser that they have accepted the agreement. This to 
avoid that people would have to accept it every time they brows to that 
web application.
I have also set up a system (thanks to Rainer ;) ) that takes a certain 
url, parses it to a different less convenient one and then forwards it 
to our Tomcat applications with JkMount.

The problem is that when people accept the cookie, they get forwarded to 
the introduction page, but the url changes to the less convenient one 
(so it doesn't get intercepted by the ProxyPassReverse) and the cookie 
is not set (at least not for the convenient one).

Settings are:
-convenient url:
http://www.esat.kuleuven.be/cartagenia/bench/demo2/
-inconvenient url:
http://www.esat.kuleuven.be/bench_demo2/
-rewrite options:
RewriteRule ^/cartagenia/bench/(.*) /bench_$1 [P]
ProxyPassReverse  /cartagenia/bench/ http://localhost/bench_
JkMount  /bench_* cartagen
-cookie settings:
 if (agree != null && !"".equals(agree)) {
        Cookie cookie = new Cookie("agree", "" + 1);
        cookie.setMaxAge(Integer.MAX_VALUE);
        response.addCookie(cookie);
        response.resetBuffer();
        RequestDispatcher patcher = request.getRequestDispatcher("/");
        patcher.forward(request, response);
    }

Anybody any idea how this can be solved?
By the way, at some point all this will probably have to go over https. 
I presume that the best way of setting this up is by having apache http 
handle the ssl connection and have an open connection between the http 
server and tomcat (tomcat is only accessible through the http server 
anyway...)

Greetings
Edwin


Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org