Removed path check when reading Cookie

The Cookie path is not passed to the server so there is no point to check
it.

Relates to gh-34
This commit is contained in:
Rob Winch
2014-11-12 21:37:02 -06:00
parent 25804f1725
commit b001580334

View File

@@ -103,18 +103,14 @@ public final class CookieHttpSessionStrategy implements HttpSessionStrategy {
private static Cookie getCookie(HttpServletRequest request, String name) {
Assert.notNull(request, "Request must not be null");
Cookie cookies[] = request.getCookies();
Cookie result = null;
if (cookies != null) {
for (Cookie cookie : cookies) {
if (name.equals(cookie.getName())) {
if(cookiePath(request).equals(cookie.getPath())) {
return cookie;
}
result = cookie;
return cookie;
}
}
}
return result;
return null;
}
private static String cookiePath(HttpServletRequest request) {