[albatross-users] Getting things *out* of session_vars?

VanL vlindberg at verio.net
Wed Apr 23 08:36:51 EST 2003


My code looks like this:

all_vars = [var1, var2, var3]

for v in all_vars:
    if not ctx.req_equals(var) or
       ctx.get_value(var) != 'some good value':
       ctx.locals.error = 'var is set to bad value'

# If you get to here, all validation checks passed
for v in all_vars:
    ctx.add_session_var(v)

Sorry if some of the function names are slightly wrong, I am away from 
the code currently.  But this should be enough to give you an idea.

VanL

Michael C. Neel wrote:

>Are you etting up a cxt.locals member befor adding to the session?
>
>ie first
>ctx.local.var = "test"
> then...
>ctx.add_session_vars("var")
>
>mike
>
>-----Original Message-----
>From: VanL [mailto:vlindberg at verio.net] 
>Sent: Tuesday, April 22, 2003 2:03 PM
>To: albatross-users at object-craft.com.au
>Subject: [albatross-users] Getting things *out* of session_vars?
>
>
>Hello,
>
>I am using sentinel values in my session_vars to check that a user has 
>both completed a required form and that the user hasn't done something 
>silly, like press back.
>
>I am dutifully adding these values to session_vars, but when I test from
>
>them on the next page, I can't find them and I am redirected back.  I 
>think that I am looking in the wrong place.
>
>I am looking in ctx.locals.   Is there another place that I should be 
>looing for saved variables? ctx.session, perhaps?
>
>Thanks,
>
>VanL
>
>_______________________________________________
>Albatross-users mailing list Albatross-users at object-craft.com.au
>https://www.object-craft.com.au/cgi-bin/mailman/listinfo/albatross-users
>  
>





More information about the Albatross-users mailing list