How can i delete or set max duration for which Cookie exists?
You can set the maximum age of a cookie with the cookie.setMaxAge(int seconds) method: Here are different options to this method, • Zero means to delete the cookie • A positive value is the maximum number of seconds the cookie will live, before it expires • A negative value means the cookie will not be stored beyond this browser session (deleted on browser close) Here is a sample code to delete cookie.