[Zope] setting session "data object timeout"

Chris McDonough chrism@zope.com
Mon, 13 Jan 2003 17:02:50 -0500


0 means don't expire, so if you set to 0, session data objects won't
go away until you restart the server.

As I'm sure you already know, you can't predict when the user will
close the browser no matter how high you set the timeout.  Setting the
timeout high might prevent the session data from expiring in a
"normal" session, preventing most problems.

A better strategy, however, would be to put some error-checking in
your application which detects when a user's session data is "new" (by
checking for some key that gets inserted maybe at the beginning of the
"transaction" that you're using sessioning for) and if the user is
requesting a page that is in the "middle" of a "transaction", redirect
them to a "your session has expired" page.  This would handle all
cases more or less gracefully, even with a "small" session timeout
time.

HTH,

- C



----- Original Message -----
From: <fred@ontosys.com>
To: <zope@zope.org>
Sent: Monday, January 13, 2003 4:16 PM
Subject: [Zope] setting session "data object timeout"


> I'm working on an application that uses the default session
management
> objects in Zope 2.5.1.  I'd like transient session data to last so
> that it does not disappear before the user closes/deletes the
browser
> window maintaining the session cookie.
>
> I'm considering setting the "Data object timeout" parameter to zero
in
> /temp_folder/session_data.  But when will the session data objects
> ever be deleted in that case?  Are they only going to disappear when
> when Zope restarts?  If so, should I instead set the timeout
parameter
> to some large value such as 1440?
>
> --
> Fred Yankowski      fred@ontosys.com           tel: +1.630.879.1312
> OntoSys, Inc     PGP keyID: 7B449345        fax: +1.630.879.1370
> www.ontosys.com     38W242 Deerpath Rd, Batavia, IL 60510-9461, USA
>
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )
>