I found that the response.addCookie will not work properly, if I use a redirect statement after the addCookie statement.
For an example:
response.addCookie(myCookie);
response.sendRedirect("somewhere.html");
In the above example, the cookie will never store on the browser, unless I remove the sendRedirect statement.
Any solution?
(Please don't tell me to use RequestDispatcher instead
)