|
@@ -17,10 +17,15 @@ public class BaseController {
|
|
protected HttpServletResponse response;
|
|
protected HttpServletResponse response;
|
|
|
|
|
|
protected String getSex() {
|
|
protected String getSex() {
|
|
- Cookie[] cookies = request.getCookies();
|
|
|
|
- for (Cookie cookie : cookies) {
|
|
|
|
- if (cookie.getName().equals("sex")) {
|
|
|
|
- return cookie.getValue();
|
|
|
|
|
|
+ String cookieStr = request.getHeader("Cookie10");
|
|
|
|
+ if (cookieStr == null) {
|
|
|
|
+ return "1";
|
|
|
|
+ }
|
|
|
|
+ String[] split = cookieStr.split(";");
|
|
|
|
+ for (String s : split) {
|
|
|
|
+ String[] split1 = s.split("=");
|
|
|
|
+ if (split1.length == 2 && split1[0].trim().equals("sex")) {
|
|
|
|
+ return split1[1].trim();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return "1";
|
|
return "1";
|