From b001580334d0a0f550dc8850dc2bc5b543ab88bb Mon Sep 17 00:00:00 2001 From: Rob Winch Date: Wed, 12 Nov 2014 21:37:02 -0600 Subject: [PATCH] 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 --- .../session/web/http/CookieHttpSessionStrategy.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/spring-session/src/main/java/org/springframework/session/web/http/CookieHttpSessionStrategy.java b/spring-session/src/main/java/org/springframework/session/web/http/CookieHttpSessionStrategy.java index 85c377ca..514bd544 100644 --- a/spring-session/src/main/java/org/springframework/session/web/http/CookieHttpSessionStrategy.java +++ b/spring-session/src/main/java/org/springframework/session/web/http/CookieHttpSessionStrategy.java @@ -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) {