Hello,
In my own opinion, session score a bit over cookie, but only a little bit. Some servlet engine implement session using cookie. It sends a cookie holding "session no." to the client. When client call back to server, it retrieves this cookie and see if there is a session with this session no.
You can also implement such a thing like this using cookie, say "your own session table". HttpSession provide everything you may want for general session but if you want something advance or specific, try implement your own.
Regards,
Siros
> -----Original Message-----
> From: Rajendra Mishra [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, November 11, 1999 7:22 AM
> To: [EMAIL PROTECTED]
> Subject: Sessions or cookies
>
>
> 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/extern> al-resources.html
>
>
> LISTSERV Help:
> http://www.lsoft.com/manuals/user/user.html
>
