Sessions save state on server and cookies on client.  For large number of
clients you can't have persistent session for each for longer than half hour or
you'll fill up your memory and then when the sessions will begin to be written
to and from the disk you'll slow down performance.  Also you may loose state
when you have to restart the engine or when it crashes.  So you're stuck with
cookies unless your clients are using more than one computer or a public
terminal to access your application.  In that case you have to create a
database on server side for storage.

As per #2 I'm not too sure what you mean but it seems like it doesn't matter
whether you use cookies or sessions to store data.  If you are talking about
authentication then it was discussed not too long ago.

dave.

Laura wrote:

> Hi to everyone,
> could someone tell me the difference between session and cookies for
> saving client state?
> When is it better one instead of the other one?
> My goals:
> 1) the client (browser) subscribes some code titles and next time he'll
> start the servlet, he mustn't subscribe again all the title, but he has
> to retrieve the last title list.
> 2) A servlet calls another servlet. Client don't have to be able to
> access immediatly to the second without pass throught the first one.
>
> thanks for help
>
> Laura
>
> ___________________________________________________________________________
> 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

--
David Mossakowski              [EMAIL PROTECTED]
Programmer                           212.310.7275
Instinet Corporation

"I don't sit idly by, I'm planning a big surprise"

___________________________________________________________________________
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