asked in JSP by (58.6k points)

1 Answer

To delete cookies is very simple. If you want to delete a cookie then you simply need to follow up following three steps −

  • Read an already existing cookie and store it in Cookie object.

  • Set cookie age as zero using setMaxAge() method to delete an existing cookie.

  • Add this cookie back into response header.

answered by (58.6k points)

Java Interview Questions and Answers 2018