Zope 2.7.2 win32 - Sessions not working

Kyle Yancey kyle at lakeofburningfire.org
Fri Aug 27 22:05:43 EDT 2004


I've scratched my chin over this for the longest time.  I think I'm
going to need some help.  I'm creating a web app with zope.  It has a
typical user login based on email and password.  A ZSql method is
called to look up the customers unique id.  That id is then assigned
to their session cookie so I can allow to them to go to an account
page where they can change their preferences.  Unfortunately, zope
sessions just don't seem to be working at all.  I know something is
being assigned, because Transient Object Container session_data says
that it contains 8 items even though I only tried to set one.  Any
help would be appreciated.

request = container.REQUEST
response =  request.RESPONSE
session = request.SESSION

html_page = """<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0
Transitional//EN">
<html><head><title></title>
<meta http-equiv="REFRESH" content="0;url=/Account"></HEAD>
<BODY></BODY></HTML>"""
if session.has_key('id'):
    return html_page

if request.REQUEST_METHOD == 'POST':
    rec = context.Sql.get_user_id(email = email, password = password)
    if rec:
        cust_id = rec.dictionaries()[0]['cust_id']
        session.set('id', cust_id)

return html_page




More information about the Python-list mailing list