View | Details | Raw Unified | Return to bug 48258
Collapse All | Expand All

(-)java/org/apache/catalina/Globals.java (+7 lines)
Lines 273-278 Link Here
273
        System.getProperty("org.apache.catalina.SESSION_COOKIE_NAME",
273
        System.getProperty("org.apache.catalina.SESSION_COOKIE_NAME",
274
                "JSESSIONID");
274
                "JSESSIONID");
275
275
276
    /**
277
     * The name of the domain used in the cookie session parameter,
278
     * if something is different than the default.  Configured in the
279
     * web.xml
280
     */
281
    public static final String SESSION_COOKIE_DOMAIN_ATTR = 
282
    	"org.apache.catalina.SESSION_COOKIE_DOMAIN";
276
283
277
    /**
284
    /**
278
     * The name of the path parameter used to pass the session identifier
285
     * The name of the path parameter used to pass the session identifier
(-)java/org/apache/catalina/connector/Request.java (-3 / +14 lines)
Lines 180-186 Link Here
180
180
181
181
182
    /**
182
    /**
183
     * The preferred Locales assocaited with this Request.
183
     * The preferred Locales associated with this Request.
184
     */
184
     */
185
    protected ArrayList locales = new ArrayList();
185
    protected ArrayList locales = new ArrayList();
186
186
Lines 2353-2359 Link Here
2353
               && getContext().getCookies()) {
2353
               && getContext().getCookies()) {
2354
            Cookie cookie = new Cookie(Globals.SESSION_COOKIE_NAME,
2354
            Cookie cookie = new Cookie(Globals.SESSION_COOKIE_NAME,
2355
                                       session.getIdInternal());
2355
                                       session.getIdInternal());
2356
            configureSessionCookie(cookie);
2356
            configureSessionCookie(cookie);            
2357
            response.addCookieInternal(cookie, context.getUseHttpOnly());
2357
            response.addCookieInternal(cookie, context.getUseHttpOnly());
2358
        }
2358
        }
2359
2359
Lines 2367-2373 Link Here
2367
    }
2367
    }
2368
2368
2369
    /**
2369
    /**
2370
     * Configures the given JSESSIONID cookie.
2370
     * Configures the given JSESSIONID cookie. The cookie domain
2371
     * can be specified by the user in the web.xml
2371
     *
2372
     *
2372
     * @param cookie The JSESSIONID cookie to be configured
2373
     * @param cookie The JSESSIONID cookie to be configured
2373
     */
2374
     */
Lines 2382-2387 Link Here
2382
        } else {
2383
        } else {
2383
            cookie.setPath("/");
2384
            cookie.setPath("/");
2384
        }
2385
        }
2386
2387
        if ((context != null) && (context.getServletContext() != null)) {
2388
        	// attempt to look up domain in web.xml
2389
        	
2390
        	String defaultDomain = context.getServletContext().getInitParameter(Globals.SESSION_COOKIE_DOMAIN_ATTR);
2391
	        if ((defaultDomain != null) && (defaultDomain.trim().length() > 0)) {
2392
	        	cookie.setDomain(defaultDomain);
2393
	        }
2394
        }
2395
        
2385
        if (isSecure()) {
2396
        if (isSecure()) {
2386
            cookie.setSecure(true);
2397
            cookie.setSecure(true);
2387
        }
2398
        }

Return to bug 48258