OSDN Git Service

user session文字列検索方法誤り修正
authoryukihane <yukihane.feather@gmail.com>
Sat, 17 Sep 2011 13:20:37 +0000 (22:20 +0900)
committeryukihane <yukihane.feather@gmail.com>
Sat, 17 Sep 2011 13:20:37 +0000 (22:20 +0900)
frontend/src/saccubus/net/Cookie.java

index 598e999..cc6dc63 100644 (file)
@@ -18,7 +18,7 @@ import org.slf4j.LoggerFactory;
 public abstract class Cookie {
 
     private static final Logger logger = LoggerFactory.getLogger(Cookie.class);
-    private static final Pattern USER_SESSION_PATTERN = Pattern.compile("user_session_[\\d_]+");
+    private static final Pattern USER_SESSION_PATTERN = Pattern.compile("(user_session_[\\d_]+)");
 
     public enum BrowserType {
 
@@ -102,7 +102,7 @@ public abstract class Cookie {
      */
     protected final String getUserSession(final String cookieStr) {
         final Matcher mather = USER_SESSION_PATTERN.matcher(cookieStr);
-        if (mather.lookingAt()) {
+        if (mather.find()) {
             return mather.group(1);
         }
         return "";