How Will You Delete a Cookie in JSP ?

We can use following options to delete a Cookie in JSP...

setMaxAge() : we can set the maximum age of a cookie. After this time period, Cookie will expire and will be deleted.

Header : We can also set the expiry time in header of response. Respone.setHeader(). This will also expire the cookie after specified time period.



You May Interest

What are the Differences Between a Vector and an ArrayList in Jav ...

What are the Differences Between a List and Set Collection in Jav ...

What are the Differences Between a Checked and Unchecked Exceptio ...

What is Thread Starvation in Java ?

What is the Difference Between Abstract Class and Interface in Ja ...