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

(-)java/org/apache/catalina/connector/Response.java (+4 lines)
Lines 1392-1397 Link Here
1392
     * a session identifier.  This will be true if all of the following
1392
     * a session identifier.  This will be true if all of the following
1393
     * conditions are met:
1393
     * conditions are met:
1394
     * <ul>
1394
     * <ul>
1395
     * <li>URL rewriting is enabled
1395
     * <li>The request we are responding to asked for a valid session
1396
     * <li>The request we are responding to asked for a valid session
1396
     * <li>The requested session ID was not received via a cookie
1397
     * <li>The requested session ID was not received via a cookie
1397
     * <li>The specified URL points back to somewhere within the web
1398
     * <li>The specified URL points back to somewhere within the web
Lines 1402-1407 Link Here
1402
     */
1403
     */
1403
    protected boolean isEncodeable(final String location) {
1404
    protected boolean isEncodeable(final String location) {
1404
1405
1406
    	if (!getContext().getUrlRewriting())
1407
    		return (false);
1408
    	
1405
        if (location == null)
1409
        if (location == null)
1406
            return (false);
1410
            return (false);
1407
1411
(-)java/org/apache/catalina/Context.java (+13 lines)
Lines 180-188 Link Here
180
     * @param cookies The new flag
180
     * @param cookies The new flag
181
     */
181
     */
182
    public void setCookies(boolean cookies);
182
    public void setCookies(boolean cookies);
183
    
184
    /**
185
     * Return the "use URL rewriting for session ids" flag.
186
     */
187
    public boolean getUrlRewriting();
183
188
184
189
185
    /**
190
    /**
191
     * Set the "use URL rewriting for session ids" flag.
192
     *
193
     * @param cookies The new flag
194
     */
195
    public void setUrlRewriting(boolean cookies);
196
197
198
    /**
186
     * Return the "allow crossing servlet contexts" flag.
199
     * Return the "allow crossing servlet contexts" flag.
187
     */
200
     */
188
    public boolean getCrossContext();
201
    public boolean getCrossContext();
(-)java/org/apache/catalina/core/StandardContext.java (+32 lines)
Lines 282-287 Link Here
282
     * Should we attempt to use cookies for session id communication?
282
     * Should we attempt to use cookies for session id communication?
283
     */
283
     */
284
    private boolean cookies = true;
284
    private boolean cookies = true;
285
    
286
    
287
    /**
288
     * Should we attempt to use URL rewriting for session id communication?
289
     */
290
    private boolean urlRewriting = true;
285
291
286
292
287
    /**
293
    /**
Lines 1099-1104 Link Here
1099
1105
1100
1106
1101
    /**
1107
    /**
1108
     * Set the "use URL rewriting for session ids" flag.
1109
     *
1110
     * @param cookies The new flag
1111
     */
1112
    public void setUrlRewriting(boolean urlRewriting) {
1113
1114
        boolean oldURLRewriting = this.urlRewriting;
1115
        this.urlRewriting = urlRewriting;
1116
        support.firePropertyChange("urlRewriting",
1117
                                   new Boolean(oldURLRewriting),
1118
                                   new Boolean(this.urlRewriting));
1119
1120
    }
1121
    
1122
    
1123
    /**
1124
     * Return the "use URL rewriting for session ids" flag.
1125
     */
1126
    public boolean getUrlRewriting() {
1127
1128
        return (this.urlRewriting);
1129
1130
    }
1131
1132
1133
    /**
1102
     * Return the "allow crossing servlet contexts" flag.
1134
     * Return the "allow crossing servlet contexts" flag.
1103
     */
1135
     */
1104
    public boolean getCrossContext() {
1136
    public boolean getCrossContext() {
(-)webapps/docs/config/context.xml (+10 lines)
Lines 223-228 Link Here
223
        application, however, to trigger reloads of deployed applications
223
        application, however, to trigger reloads of deployed applications
224
        on demand.</p>
224
        on demand.</p>
225
      </attribute>
225
      </attribute>
226
      
227
      <attribute name="urlRewriting" required="false">
228
        <p>Set to <code>true</code> if you want URL rewriting to be available for
229
        session identifier communication (the default is <code>true</code>).  
230
        Set to <code>false</code> if you want to disable the use of URL rewriting 
231
        for session identifier communication, and rely only on cookies. Note that 
232
        either <code>cookies</code> or <code>urlRewriting</code> must be enabled 
233
        for sessions to work.</p>
234
      </attribute>
235
      
226
236
227
      <attribute name="wrapperClass" required="false">
237
      <attribute name="wrapperClass" required="false">
228
        <p>Java class name of the <code>org.apache.catalina.Wrapper</code>
238
        <p>Java class name of the <code>org.apache.catalina.Wrapper</code>

Return to bug 45255