Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: Web
Expertise: Intermediate
Nov 17, 2001

How to Void a Cookie and Delete it from the Browser


You can specify an expiration date, using the setMaxTime(int) method of javax.servlet.http.Cookie. Specifying an expiration time of zero will void the cookie, and delete it from the browser.
 
// Expire the cookie immediately
cookie.setMaxTime( 0 );

// Send cookie back to the browser to void it
response.addCookie(cookie);
Sandeep Gain
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date