Re: Basics about passing variable to the user's session

Germán Rimoldi <[email protected]> Mon, 9 Jan 2017 04:55:19 -0800 (PST)
Newsgroups gmane.comp.python.cherrypy
Message-ID <[email protected]>
We have opened this issue on Stackoverflow, please your help! :)

http://stackoverflow.com/questions/41539543/how-to-store-cherrypy-session-in-a-variable

On Sunday, January 8, 2017 at 7:42:28 PM UTC-3, Germán Rimoldi wrote:
>
> 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.