Groups
Groups
Sign in
Groups
Groups
web2py-users
Conversations
Labels
About
Send feedback
Help
Is it possible to write to session variables from Web2py modules?
84 views
Skip to first unread message
at
unread,
Jan 21, 2021, 2:01:36 AM
1/21/21
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to web2py-users
Is it possible to write to session variables from Web2py modules?
黄祥
unread,
Jan 22, 2021, 10:34:29 PM
1/22/21
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to web2py-users
Is it possible to write to session variables from Web2py modules?
yes, it is
ref:
http://web2py.com/books/default/chapter/29/04/the-core?search=current.#Accessing-the-API-from-Python-modules
best regards,
stifan
Clemens
unread,
Jan 23, 2021, 4:53:26 AM
1/23/21
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to web2py-users
Just reference the session in the module by:
session = current.session
Then you can use exactly in the same way as in the controllers.
Best regards
Clemens
at
unread,
Jan 23, 2021, 5:21:47 AM
1/23/21
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to web2py-users
Thank you
Stifan & Clemens for the help!
Best Regards
Reply all
Reply to author
Forward
0 new messages