Basics about passing variable to the user's session

Germán Rimoldi <[email protected]> Sun, 8 Jan 2017 14:42:28 -0800 (PST)
Newsgroups gmane.comp.python.cherrypy
Message-ID <[email protected]>

Hi Guys! 


I need help passing variable to the user's session and calling this from a 
different function: Could you help me out with this?


First, I would like ot "set" a variable on the user's session.


@cherrypy.exposedef setter(self):
    email = "[email protected]"
    cherrypy.session["email"] = email
    return "Variable passed to session"        


Second, I would like to call that variable from the session on a different 
function.

@cherrypy.exposedef getter(self):
    return cherrypy.session.get("email")        

-- 
You received this message because you are subscribed to the Google Groups "cherrypy-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cherrypy-users+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/[email protected]
To post to this group, send email to cherrypy-users-/JYPxA39Uh5TLH3MbocFF+G/[email protected]
Visit this group at https://groups.google.com/group/cherrypy-users.
For more options, visit https://groups.google.com/d/optout.