Consider the code... I got the request parameters using request.getParameter() method and created a cookie object based on the request parameter and added the cookie object to response object.
My question is, when I forwarded the request to another servlet, isn't the response objects buffer deleted and a new response object is forwarded along with the request object ?? So, i'm guessing the cookie added to response object is also deleted. so, how all this works ??
When I click on login button the LoginServlet gets invoked.
Consider there is another servlet "ForwardServlet" to which the request is being forwarded.