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

(-)java/org/apache/catalina/core/ApplicationContext.java (-2 / +8 lines)
Lines 1176-1183 Link Here
1176
1176
1177
    private void populateSessionTrackingModes() {
1177
    private void populateSessionTrackingModes() {
1178
        // URL re-writing is always enabled by default
1178
        // URL re-writing is always enabled by default
1179
        defaultSessionTrackingModes = EnumSet.of(SessionTrackingMode.URL); 
1179
    	
1180
        supportedSessionTrackingModes = EnumSet.of(SessionTrackingMode.URL);
1180
    	defaultSessionTrackingModes = EnumSet.noneOf(SessionTrackingMode.class);
1181
    	supportedSessionTrackingModes = EnumSet.noneOf(SessionTrackingMode.class);
1182
1183
    	if(!context.isDisableUrlSessionTracking()) {
1184
	        defaultSessionTrackingModes.add(SessionTrackingMode.URL); 
1185
	        supportedSessionTrackingModes.add(SessionTrackingMode.URL);
1186
    	}
1181
        
1187
        
1182
        if (context.getCookies()) {
1188
        if (context.getCookies()) {
1183
            defaultSessionTrackingModes.add(SessionTrackingMode.COOKIE);
1189
            defaultSessionTrackingModes.add(SessionTrackingMode.COOKIE);
(-)java/org/apache/catalina/core/StandardContext.java (+18 lines)
Lines 313-318 Link Here
313
313
314
314
315
    /**
315
    /**
316
     * Should we disable URL rewriting for session tracking? 
317
     */
318
    private boolean disableUrlSessionTracking = false;
319
    
320
    /**
316
     * Should we allow the <code>ServletContext.getContext()</code> method
321
     * Should we allow the <code>ServletContext.getContext()</code> method
317
     * to access the context of other web applications in this server?
322
     * to access the context of other web applications in this server?
318
     */
323
     */
Lines 1404-1409 Link Here
1404
    }
1409
    }
1405
    
1410
    
1406
    
1411
    
1412
    public boolean isDisableUrlSessionTracking() {
1413
		return disableUrlSessionTracking;
1414
	}
1415
1416
1417
	public void setDisableUrlSessionTracking(boolean disableUrlSessionTracking) {
1418
		boolean oldDisableUrlSessionTracking = this.disableUrlSessionTracking;
1419
		this.disableUrlSessionTracking = disableUrlSessionTracking;
1420
		support.firePropertyChange("disableUrlSessionTracking",
1421
				oldDisableUrlSessionTracking, this.disableUrlSessionTracking);
1422
	}
1423
1424
1407
    /**
1425
    /**
1408
     * Gets the name to use for session cookies. Overrides any setting that
1426
     * Gets the name to use for session cookies. Overrides any setting that
1409
     * may be specified by the application.
1427
     * may be specified by the application.
(-)java/org/apache/catalina/core/mbeans-descriptors.xml (+4 lines)
Lines 166-171 Link Here
166
               type="java.lang.String"
166
               type="java.lang.String"
167
               writeable="false" />
167
               writeable="false" />
168
          
168
          
169
    <attribute name="disableUrlSessionTracking"
170
               description="Should we disable URL rewriting for session tracking?"
171
               type="boolean"/>
172
169
    <attribute name="displayName"
173
    <attribute name="displayName"
170
               description="The display name of this web application"
174
               description="The display name of this web application"
171
               type="java.lang.String"/>
175
               type="java.lang.String"/>
(-)webapps/docs/config/context.xml (+8 lines)
Lines 168-173 Link Here
168
        return <code>null</code>.</p>
168
        return <code>null</code>.</p>
169
      </attribute>
169
      </attribute>
170
170
171
      <attribute name="disableUrlSessionTracking" required="false">
172
        <p>Set to <code>true</code> if you want to disable URL rewriting
173
        for session identifier communication. In this case, either
174
        <code>cookies</code> should be set to <code>true</code> or 
175
        SSL should be enabled to track sessions.
176
        Default value is <code>false</code>.</p>
177
      </attribute>
178
171
      <attribute name="docBase" required="true">
179
      <attribute name="docBase" required="true">
172
        <p>The <em>Document Base</em> (also known as the <em>Context
180
        <p>The <em>Document Base</em> (also known as the <em>Context
173
        Root</em>) directory for this web application, or the pathname
181
        Root</em>) directory for this web application, or the pathname

Return to bug 50305