On Mon, 19 Aug 2002, Gopinath D wrote:

> What is the difference between Session and Cookie?

A cookie is something that a server sends a browser and that a browser
sends back to a server.  A session, at a high level, represents a single
user's interaction with a web application; it may be implemented in terms
of cookies, URL rewriting, or other mechanisms entirely.

A cookie sends an individual value to a browser.  By contrast, a session
(in the Servlet API and thus in JSP) provides the ability to store
multiple attributes (key/value pairs), which are all indexed automatically
to the user's visit to the site (his or her "session").  The Servlet
container (e.g., Tomcat) takes care of managing the session, perhaps by
sending a cookie that contains a token which the server uses to identify
the session.

Hope this helps,

--
Shawn Bayern
"JSTL in Action"   http://www.jstlbook.com

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

Reply via email to