public void getHoge(HttpServletRequest request) { if (request.getCookies() != null) { Cookie[] cookies = request.getCookies(); String loginname = null; for (Cookie cookie : cookies) { if (cookie.getName().equals("loginname")) { loginname = cookie.getValue(); } } } }