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

Creating a Map with Reverse View and Lookup in Java

What is a Shutdown Hook in Java ?

What is the Main Difference Between a Session and Cookie in JSP ?

What are the Main Benefits of Collections Framework in Java ?

How Can We Prevent a Deadlock in Java ?