Cookie is that goodie that is sent back to the client (Eg: Browser). It is a mechanism by which the server distinguishes client requests and maintains session on the server.

Documentation from Netscape on cookies can be found here:

A treatment on HTTP Session Management is here:


A Cookie is so tasty that somebody has a website for it:


I would like to remind users to always use response.setEncodeURL(url) to encode the url just in case the client's browser does not eat cookies.


Generally, users want to invalidate sessions on logout. So they invalidate the session on the serverside. But do send back a cookie with MaxAge set to 0, so that lingering session cookies in the browser do not create problems in your servlet code.


Cookie Max Age

Go get some cookies!!!