Skip to content

Commit

Permalink
Fixes bug 3192302. Cookie manager was not tokenizing the session cook…
Browse files Browse the repository at this point in the history
…ies properly.

git-svn-id: https://olap4j.svn.sourceforge.net/svnroot/olap4j/trunk@428 c6a108a4-781c-0410-a6c6-c2d559e19af0
  • Loading branch information
lucboudreau committed Mar 24, 2011
1 parent 09ef658 commit 47b89a4
Showing 1 changed file with 22 additions and 17 deletions.
39 changes: 22 additions & 17 deletions src/org/olap4j/driver/xmla/proxy/XmlaOlap4jCookieManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -131,25 +131,30 @@ public void storeCookies(URLConnection conn) {

while (st.hasMoreTokens()) {
String token = st.nextToken();
cookie.put(
token.substring(
0,
token.indexOf(NAME_VALUE_SEPARATOR)).toLowerCase(),
token.substring(
token.indexOf(NAME_VALUE_SEPARATOR) + 1,
token.length()));

if (this.debug) {
System.out.println(
"Saving cookie : "
+ token.substring(
// Check if the separator does exist
// The other attributes are not stored (Ex: HttpOnly)
int separatorIndex = token.indexOf(NAME_VALUE_SEPARATOR);

if (separatorIndex > 0) {
String tokenName =
token.substring(
0,
token.indexOf(
NAME_VALUE_SEPARATOR)).toLowerCase()
+ "="
+ token.substring(
token.indexOf(NAME_VALUE_SEPARATOR) + 1,
token.length()));
separatorIndex)
.toLowerCase();
String tokenValue =
token.substring(
separatorIndex + 1,
token.length());

cookie.put(tokenName, tokenValue);

if (this.debug) {
System.out.println(
"Saving cookie : "
+ tokenName
+ "=" + tokenValue);
}
}
}
}
Expand Down

0 comments on commit 47b89a4

Please sign in to comment.