[Zope] Handling Session Timeouts
Thu, 6 Jun 2002 15:38:02 +1000
Thanks Chris, this is exactly what I needed.
From: email@example.com [mailto:firstname.lastname@example.org]On Behalf Of Chris
Sent: Thursday, 6 June 2002 12:40 AM
Cc: Michael Fox; email@example.com
Subject: Re: [Zope] Handling Session Timeouts
There is also a modifier to RESPONSE.redirect named "lock" that locks
the status code to 302 and disallows any errors to change the status
code. This is also a reasonable way of avoiding this problem.
On Wed, 2002-06-05 at 10:55, hans wrote:
> Chris McDonough wrote:
> > When you do a RESPONSE.redirect, the rest of the page is still =
> > it's not until the response is sent back to the browser that the =
> > happens.
> > The "missing" modifier to dtml var is useful here:
> > <dtml-var var1 missing>
> > ----- Original Message -----
> > From: "Michael Fox" <Michael@Wodin.CenturySoftware.com.au>
> > To: <firstname.lastname@example.org>
> > Sent: Tuesday, June 04, 2002 8:57 PM
> > Subject: [Zope] Handling Session Timeouts
> > Hi *,
> > In an attempt to handle session timeouts, I'm wondering if someone =
> > list can enlighten me.
> > My application utilises Zope's Transient Object Container & Session =
> > Manager.
> > Once a user is authenticated, I set several variables in my Session =
> > Manager with the values from a HTML form -
> > <dtml-call "REQUEST.SESSION.set('var1', var1 )">
> > <dtml-call "REQUEST.SESSION.set('var2', var2 )">
> > <dtml-call "REQUEST.SESSION.set('var3', var3 )">
> > Now these are variables are in my SDM, I set these in my
> > standard_html_header as such...
> > <dtml-call "REQUEST.set('var1',REQUEST.SESSION['var1'])">
> > <dtml-call "REQUEST.set('var2',REQUEST.SESSION['var2'])">
> > <dtml-call "REQUEST.set('var3',REQUEST.SESSION['var3'])">
> > This way I can access any session variables via <dtml-var var1> =
> > <dtml-var "REQUEST.SESSION['var1']">
> > Am I on the right track so far?
> > My problem is handling timeouts. My Trasient Object Container has a =
> > value of 20 mins.
> > In my attempt to handle timeouts, I have the following code in my
> > standard_html_header -
> > <dtml-if "REQUEST.SESSION.has_key('var1')">
> > the session still has this key, therefore must be active, do =
> > <dtml-else>
> > <dtml-call "RESPONSE.redirect('login_page')">
> > </dtml-if>
> or put <dtml-return> after redirect
> > * The rest of my HTML code goes here.
> > The problem is the redirect isn't working and Zope attempts to =
> > page... thus resulting in a Zope error.
> > Does anyone have a working solution to this? or could point me in =
> > direction of some Docs/HOW-TO's?
> > Any help appreciated.
> > Regards,
> > Michael
Zope maillist - Zope@zope.org
** No cross posts or HTML encoding! **
(Related lists -=20