Make session cookie name configurable via sessionCookieName in apps.properties
(merge from helma_1_4)
This commit is contained in:
parent
bcf5542565
commit
344c0da36e
2 changed files with 25 additions and 11 deletions
|
@ -281,6 +281,7 @@ public class ApplicationManager implements XmlRpcHandler {
|
|||
String[] staticHome;
|
||||
String xmlrpcHandlerName;
|
||||
String cookieDomain;
|
||||
String sessionCookieName;
|
||||
String uploadLimit;
|
||||
String debug;
|
||||
boolean encode;
|
||||
|
@ -308,6 +309,7 @@ public class ApplicationManager implements XmlRpcHandler {
|
|||
protectedStaticDir = props.getProperty(name + ".protectedStatic");
|
||||
|
||||
cookieDomain = props.getProperty(name + ".cookieDomain");
|
||||
sessionCookieName = props.getProperty(name + ".sessionCookieName");
|
||||
uploadLimit = props.getProperty(name + ".uploadLimit");
|
||||
debug = props.getProperty(name + ".debug");
|
||||
encode = "true".equalsIgnoreCase(props.getProperty(name +
|
||||
|
@ -454,6 +456,10 @@ public class ApplicationManager implements XmlRpcHandler {
|
|||
holder.setInitParameter("cookieDomain", cookieDomain);
|
||||
}
|
||||
|
||||
if (sessionCookieName != null) {
|
||||
holder.setInitParameter("sessionCookieName", sessionCookieName);
|
||||
}
|
||||
|
||||
if (uploadLimit != null) {
|
||||
holder.setInitParameter("uploadLimit", uploadLimit);
|
||||
}
|
||||
|
@ -551,6 +557,5 @@ public class ApplicationManager implements XmlRpcHandler {
|
|||
public String toString() {
|
||||
return "[AppDescriptor "+app+"]";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -48,6 +48,9 @@ public abstract class AbstractServletClient extends HttpServlet {
|
|||
// cookie domain to use
|
||||
String cookieDomain;
|
||||
|
||||
// cookie name for session cookies
|
||||
String sessionCookieName = "HopSession";
|
||||
|
||||
// allow caching of responses
|
||||
boolean caching;
|
||||
|
||||
|
@ -76,6 +79,12 @@ public abstract class AbstractServletClient extends HttpServlet {
|
|||
cookieDomain = cookieDomain.toLowerCase();
|
||||
}
|
||||
|
||||
sessionCookieName = init.getInitParameter("sessionCookieName");
|
||||
|
||||
if (sessionCookieName == null) {
|
||||
sessionCookieName = "HopSession";
|
||||
}
|
||||
|
||||
debug = ("true".equalsIgnoreCase(init.getInitParameter("debug")));
|
||||
caching = !("false".equalsIgnoreCase(init.getInitParameter("caching")));
|
||||
}
|
||||
|
@ -171,7 +180,7 @@ public abstract class AbstractServletClient extends HttpServlet {
|
|||
String nextKey = reqCookies[i].getName();
|
||||
String nextPart = reqCookies[i].getValue();
|
||||
|
||||
if ("HopSession".equals(nextKey)) {
|
||||
if (sessionCookieName.equals(nextKey)) {
|
||||
reqtrans.session = nextPart;
|
||||
} else {
|
||||
reqtrans.set(nextKey, nextPart);
|
||||
|
@ -502,7 +511,7 @@ public abstract class AbstractServletClient extends HttpServlet {
|
|||
System.currentTimeMillis(), 36));
|
||||
|
||||
reqtrans.session = b.toString();
|
||||
Cookie c = new Cookie("HopSession", reqtrans.session);
|
||||
Cookie c = new Cookie(sessionCookieName, reqtrans.session);
|
||||
|
||||
c.setPath("/");
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue