As for the subject: Are USERLANGUAGE and JSESSIONID cookies implicitly part of HttpServletRequest? Even without declaring any httpsession?
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
// HttpSession session = req.getSession(true);
Cookie[] cookies = req.getCookies();
ServletOutputStream out = resp.getOutputStream();
out.println("<html>");
out.println("<head>");
out.println("</head>");
out.println("<body>");
for (Cookie cookie : cookies) {
out.println(cookie.getName()+": "+ cookie.getValue());
}
out.println("</body>");
out.println("</html>");
}
In the above code reported for example even though I do not declare any httpSession I get USERLANGUAGE and JSESSIONID as part of the Cookies array. Should not I have got null
instead?