01: /*
02: * All content copyright (c) 2003-2007 Terracotta, Inc., except as may otherwise be noted in a separate copyright
03: * notice. All rights reserved.
04: */
05: package org.apache.catalina.connector;
06:
07: import com.terracotta.session.util.DefaultCookieWriter;
08:
09: import javax.servlet.http.Cookie;
10: import javax.servlet.http.HttpServletRequest;
11:
12: public class Tomcat55CookieWriter extends DefaultCookieWriter {
13:
14: public Tomcat55CookieWriter(boolean isTrackingEnabled,
15: boolean isCookieEnabled, boolean isUrlRewriteEnabled,
16: String cookieName, String cookieDomain, String cookiePath,
17: String cookieComment, int cookieMaxAge,
18: boolean isCookieSecure) {
19: super (isTrackingEnabled, isCookieEnabled, isUrlRewriteEnabled,
20: cookieName, cookieDomain, cookiePath, cookieComment,
21: cookieMaxAge, isCookieSecure);
22: }
23:
24: protected String computeCookiePath(HttpServletRequest req) {
25: // use tomcat's logic for determining the cookie path
26: Request internalReq = (Request) req;
27:
28: Cookie tmp = new Cookie("invalid", "invalid");
29: internalReq.configureSessionCookie(tmp);
30:
31: return tmp.getPath();
32: }
33:
34: }
|