Adding cookie in java and then HTTP redirect doesnt show cookie in client side
问题 I have requirement where in i need to add cookie in java and then redirect it to different URL. Now this url process should persist the cookie which i set and after its processing send it back to client. The code goes as follows Cookie cookie = new Cookie("name", "value") // To make sure cookie is established for all the url paths cookie.setPath(request.getContextPath()); response.addCookie(cookie); response.sendRedirect("someNewUrl"); Please help me regarding how can i persist the cookie