My fledgling app is driving users crazy.  I use the session to store a
list of strings, and then use "prev" and "next" controllers to
redirect to a page by indexing into that list.  Ever since I enabled
this feature, users randomly lose their auth and are forced to re-
logon.  This blows away the list and index and forces them to restart
the sequence.

I've read all about session vars and how they need to be serialized.
The list is a simple Python list of either ints or strings (I've tried
both).  I also store the current index pointer into the list, again as
either a string or int.  The effect is completely random -- sometimes
it will let you "next" or "prev" without complaint and then *bam*
suddenly it forces you to re-logon with every click of "next" or
"prev".

Here is the "string" version of "next":

def event_next():
    if  session.eventlist and (int(session.eventptr)>=0):
        tmp=int(session.eventptr)+1
        if tmp>=len(session.eventlist):
            tmp=0
        session.eventptr=str(tmp)
 
redirect(URL('meet','signup',args=[int(session.eventlist[tmp])]))
    session.flash="Lost sync with events!"
    redirect(URL('meet','index'))

Is there a better way?  These session vars are driving me crazy!

-- Joe

Reply via email to