Author: markt
Date: Tue Mar 24 12:43:25 2009
New Revision: 757764
URL: http://svn.apache.org/viewvc?rev=757764&view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=42419
Support changing of JSESSIONID cookie name and jsessionid path parameter name
Modified:
tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/Globals.java
tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/authenticator/Constants.java
tomcat/container/tc5.5.x/webapps/docs/config/systemprops.xml
tomcat/jasper/tc5.5.x/src/share/org/apache/jasper/Constants.java
tomcat/jasper/tc5.5.x/src/share/org/apache/jasper/tagplugins/jstl/Util.java
Modified:
tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/Globals.java
URL:
http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/Globals.java?rev=757764&r1=757763&r2=757764&view=diff
==============================================================================
---
tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/Globals.java
(original)
+++
tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/Globals.java
Tue Mar 24 12:43:25 2009
@@ -269,14 +269,18 @@
* The name of the cookie used to pass the session identifier back
* and forth with the client.
*/
- public static final String SESSION_COOKIE_NAME = "JSESSIONID";
+ public static final String SESSION_COOKIE_NAME =
+ System.getProperty("org.apache.catalina.SESSION_COOKIE_NAME",
+ "JSESSIONID");
/**
* The name of the path parameter used to pass the session identifier
* back and forth with the client.
*/
- public static final String SESSION_PARAMETER_NAME = "jsessionid";
+ public static final String SESSION_PARAMETER_NAME =
+ System.getProperty("org.apache.catalina.SESSION_PARAMETER_NAME",
+ "jsessionid");
/**
Modified:
tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/authenticator/Constants.java
URL:
http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/authenticator/Constants.java?rev=757764&r1=757763&r2=757764&view=diff
==============================================================================
---
tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/authenticator/Constants.java
(original)
+++
tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/authenticator/Constants.java
Tue Mar 24 12:43:25 2009
@@ -40,7 +40,10 @@
public static final String FORM_USERNAME = "j_username";
// Cookie name for single sign on support
- public static final String SINGLE_SIGN_ON_COOKIE = "JSESSIONIDSSO";
+ public static final String SINGLE_SIGN_ON_COOKIE =
+ System.getProperty(
+
"org.apache.catalina.authenticator.Constants.SSO_SESSION_COOKIE_NAME",
+ "JSESSIONIDSSO");
// --------------------------------------------------------- Request Notes
Modified: tomcat/container/tc5.5.x/webapps/docs/config/systemprops.xml
URL:
http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/webapps/docs/config/systemprops.xml?rev=757764&r1=757763&r2=757764&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/webapps/docs/config/systemprops.xml (original)
+++ tomcat/container/tc5.5.x/webapps/docs/config/systemprops.xml Tue Mar 24
12:43:25 2009
@@ -117,6 +117,34 @@
</section>
+<section name="Sessions">
+
+ <properties>
+
+ <property name="org.apache.catalina.SESSION_COOKIE_NAME">
+ <p>An alternative name for the session cookie. Defaults to
+ <code>JSESSIONID</code>. Note that the Servlet specification requires
+ this to be <code>JSESSIONID</code>. You should not rely on being able to
+ change this.</p>
+ </property>
+
+ <property name="org.apache.catalina.SESSION_PARAMETER_NAME">
+ <p>An alternative name for the session path parameter. Defaults to
+ <code>jsessionid</code>. Note that the Servlet specification requires
+ this to be <code>jsessionid</code>. You should not rely on being able to
+ change this.</p>
+ </property>
+
+ <property name="org.apache.catalina.SSO_SESSION_COOKIE_NAME">
+ <p>An alternative name for the single sign on session cookie. Defaults to
+ <code>JSESSIONIDSSO</code>.</p>
+ </property>
+
+ </properties>
+
+</section>
+
+
<section name="Other">
<properties>
Modified: tomcat/jasper/tc5.5.x/src/share/org/apache/jasper/Constants.java
URL:
http://svn.apache.org/viewvc/tomcat/jasper/tc5.5.x/src/share/org/apache/jasper/Constants.java?rev=757764&r1=757763&r2=757764&view=diff
==============================================================================
--- tomcat/jasper/tc5.5.x/src/share/org/apache/jasper/Constants.java (original)
+++ tomcat/jasper/tc5.5.x/src/share/org/apache/jasper/Constants.java Tue Mar 24
12:43:25 2009
@@ -211,5 +211,13 @@
*/
public static final String HACK_STR = "'\\ue000'";
+ /**
+ * The name of the path parameter used to pass the session identifier
+ * back and forth with the client.
+ */
+ public static final String SESSION_PARAMETER_NAME =
+ System.getProperty("org.apache.catalina.SESSION_PARAMETER_NAME",
+ "jsessionid");
+
}
Modified:
tomcat/jasper/tc5.5.x/src/share/org/apache/jasper/tagplugins/jstl/Util.java
URL:
http://svn.apache.org/viewvc/tomcat/jasper/tc5.5.x/src/share/org/apache/jasper/tagplugins/jstl/Util.java?rev=757764&r1=757763&r2=757764&view=diff
==============================================================================
--- tomcat/jasper/tc5.5.x/src/share/org/apache/jasper/tagplugins/jstl/Util.java
(original)
+++ tomcat/jasper/tc5.5.x/src/share/org/apache/jasper/tagplugins/jstl/Util.java
Tue Mar 24 12:43:25 2009
@@ -33,6 +33,8 @@
import javax.servlet.jsp.JspTagException;
import javax.servlet.jsp.PageContext;
+import org.apache.jasper.Constants;
+
/**
* Util contains some often used consts, static methods and embedded class
* to support the JSTL tag plugin.
@@ -150,7 +152,8 @@
public static String stripSession(String url) {
StringBuffer u = new StringBuffer(url);
int sessionStart;
- while ((sessionStart = u.toString().indexOf(";jsessionid=")) != -1) {
+ while ((sessionStart = u.toString().indexOf(";" +
+ Constants.SESSION_PARAMETER_NAME + "=")) != -1) {
int sessionEnd = u.toString().indexOf(";", sessionStart + 1);
if (sessionEnd == -1)
sessionEnd = u.toString().indexOf("?", sessionStart + 1);
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]