Possible Duplicate:
Differences between cookies and sessions?
what are the difference between using cookie or session in a servlet? when is better to use cookie or session information?
Possible Duplicate:
Differences between cookies and sessions?
what are the difference between using cookie or session in a servlet? when is better to use cookie or session information?
Cookie is a special HTTP header that can contain several key/value pairs. The special feature of cookie is that clients (typically browsers) are able to store them. Cookies have expiration time. Cookies as all other HTTP headers are sent with HTTP request that can be accessed by servlet.
One of cookies can contain session ID.
Session is an entity that identified by session ID and can contain information about current client/server negotiation sequence. For example attributes.
I hope this helps. For more information try to read http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol, then continue reading about Java servlet API