Argh.

I tried it, but unfortunately trans.hasSession() doesn't seem to be
solving my problem.

Here's a sample of my code, as per your suggestion:

import lib.Config
from BasicFrame import BasicFrame

class AuthFrame(BasicFrame):
    def awake(self, trans):
        BasicFrame.awake(self, trans)

        if not trans.hasSession():
            try:
                self.session().setValue('target', self.request().uri())
                self.response().sendRedirect('login')
            except:
                self.writeln('Could not create authenticated session.')

If there is no session cookie, as there is not after I've forcibly
deleted it, I want any request to a page inheriting AuthFrame to go to
my login page. I apologize if I'm missing something really plain but
I've done this sort of thing before so I'm really confused.

On Wed, 30 Mar 2005 16:26:10 -0500, Geoffrey Talvola
<[EMAIL PROTECTED]> wrote:
> Greg McClure wrote:
> > I need to detect if the session cookie is present or not, *before* the
> > rest of a page executes. Right now my protected pages are inheriting
> > from an AuthFrame class which uses the awake method to handle this
> > stuff. I have caching turned off.
> 
> How about self.transaction().hasSession() -- does that meet your needs?
> 
> - Geoff
>


-------------------------------------------------------
This SF.net email is sponsored by Demarc:
A global provider of Threat Management Solutions.
Download our HomeAdmin security software for free today!
http://www.demarc.com/info/Sentarus/hamr30
_______________________________________________
Webware-discuss mailing list
Webware-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/webware-discuss

Reply via email to