> Is it a good idea to tie a cookie with a life time of -1, set to the
session
> id and when the browser process is terminated (no ambiguity!), the session
> associated with the cookie would be invalidated?

To answer the question everyone else skipped, you're missing the point on
the browser/server connection.  There isn't one!  Once you have delivered
the HTML, Images or other data to the browser, the connection is broken.  If
the user clicks on a link on your page that takes them further into your
site, a new HTTP connection is established and the process starts over.
 The -1 age for a cookie means that the browser should not store that cookie
persistantly, but it does not notify you when those cookies are being
discarded.
    (*Chris*)

----- Original Message -----
From: Tim Crook <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, August 10, 1999 2:24 PM
Subject: Further on Session problems with Java Servlet Programming Book...


> Yes, I know I could do things with connection pooling, but I want
different
> users logged in as their real user ids, not using a dummy user everyone
> uses.
>
> Is it a good idea to tie a cookie with a life time of -1, set to the
session
> id and when the browser process is terminated (no ambiguity!), the session
> associated with the cookie would be invalidated?
>
>                 -----Original Message-----
>                 From:   jon * [mailto:[EMAIL PROTECTED]]
>                 Sent:   Tuesday, August 10, 1999 4:07 PM
>                 To:     [EMAIL PROTECTED]
>                 Subject:        Re: Session problems with Java Servlet
> Programming Book...
>
>                 > I was under the impression that
>                 > upon leaving my browser my session would automatically
be
> invalidated and
>                 > hence my database connection would be closed when
> valueUnbound was called,
>                 > but its not being called. Do I need to override the
> session identifier's
>                 > expiry? Any ideas?
>
>                 Wrong. Sessions are expired by the servlet engine or when
> you close them.
>                 How does the servlet engine know that you have closed your
> browser?
>
>                 Also, why are you trying to store a database connection in
a
> session? That
>                 is crazy. ;-) Use a connection pool instead. I have one
> implemented in Dash
>                 that is quite cool cause it uses the Singleton methods to
> cache
>                 connections...
>
>
>
<http://www.working-dogs.com/dash/cvsweb/index.cgi/dash/com/workingdogs/dash
>                 /util/db>
>
>                 -jon
>
>
>
___________________________________________________________________________
>                 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
>
>
___________________________________________________________________________
> 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
>

___________________________________________________________________________
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