-
Bug
-
Resolution: Done
-
Major
-
None
-
None
When in servlet I create new session and ask for requested session id request.getRequestedSessionId(), for new client it returns id of newly created session instead of null (client didn't specify any session Id).
@WebServlet(name="SessionTimeoutCheck", urlPatterns={"/SessionTimeoutCheck"}) public class SessionTimeoutCheckServlet extends HttpServlet { @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { HttpSession session = request.getSession(); response.setContentType("text/html"); PrintWriter out = response.getWriter(); out.write("Requested session ID " + request.getRequestedSessionId()); out.write("<br />"); if (request.getRequestedSessionId() != null) { if (request.isRequestedSessionIdValid()) { out.write("Valid session"); } else { out.write("Session expired"); } } else { out.write("No sessionId specified => new session"); } } }