Hi,
    I think that this is a very simple questin but can somebody tell me why
sessions are better than cookies (or vice versa!). I could off-hand think of
the following reasons why i would prefer to user sessions rather than
cookies :
1 - Cookies may hv been turnedoff on the client.
2 - Instead of writng code to read/write cookies in JS and/or servlets, the
session-validation etc can be done only once on the server-side with queries
to the database(if need be).
3 - No need of assuming the expiry date of the cookie. Servlet can simply
invalidate the session.

    The necessity of cookies I feel would be when we need to store
informtion for longer than the current session. However, I am toying with
the idea of writing the session attributes to a file and then reading it
from there. But I do not know how i can differentiate different
session-attributes to different machines. Can somebody throw some light on
how I can implement server-side cookies(!!).

thanks.
raaj.

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to