Is it true session is expensive?
Quoted from weblogic site (Performance tuning)
"Minimizing Sessions
Use sessions sparingly. Sessions should only be
used for state which cannot realistically be kept on
the client or if URL rewriting support is
required. Use of sessions involves a scalability
trade off. Simple bits of state, such as a user's
name, should be kept in cookies directly. If
desired one can write a wrapper class to do the
getting and setting of these cookies in order to make
life easier for other servlet
developers working on the same project. The fewer
accesses made to a session object the better; each is
a costly operation. Keep
frequently used values in local variables. Put
aggregate objects rather than multiple single objects
into the session where possible.
"
Thanks
--- Kevin Mukhar <[EMAIL PROTECTED]> wrote:
> Vivek Singh wrote:
> >
> > i have this before and didnt get satisfactory
> answer...
> > 1. Isnt just the session id is sent to the
> browser when u use session
> > tracking API?
>
> Yes and no. If your application does not create any
> cookies, then only
> the session id is sent by the server/servlet
> container. If your
> application creates any cookies and adds those
> cookies to the response,
> then the additional application cookies are sent as
> well.
>
> > 2. When one uses cookies all the name value
> pairs are stored on Hard
> > Disk ?
>
> No. Cookies are only stored on the Hard Disk if they
> are persistent
> cookies. A cookie is made persistent by setting the
> max age property to
> some positive value. If you do not set the max age
> property, or you set
> the max age property to zero or a negative value,
> the cookie will not be
> saved to the permanent store by the browser. When
> the browser is exited,
> only persistent cookies are saved. I expect that if
> the max age for a
> cookie has passed, then that cookie is also not
> saved.
>
> > If i am right then why should one need cookie
> after all when everything can
> > be done by Session Tracking API.
>
> Because some web applications don't want to store a
> lot of user
> preference information on the server
>
> Because an html form may need information from a
> previous page, but the
> application developer didn't want the user to be
> able to easily see that
> information if it was stored in hidden form fields
>
> Because using cookies allows companies to track user
> behavior across
> multiple domains (e.g. doubleclick)
>
> Because.....
>
> There are probably other reasons. Likewise, there
> are times when it
> makes more sense to store data in the session
> object. Use the tool that
> best solves the problem ("best" being defined by the
> goals of your
> application).
>
> K Mukhar
>
>
___________________________________________________________________________
> 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
__________________________________________________
Do You Yahoo!?
Send instant messages & get email alerts with Yahoo! Messenger.
http://im.yahoo.com/
___________________________________________________________________________
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