Share sessions

29 views
Skip to first unread message

Annet

unread,
Oct 13, 2020, 1:16:41 PM10/13/20
to web2py-users
In the model files of my applications I have these lines of code
because I want to share the session, so menus etc. reflect the
correct state and users need not login twice

# share the session cookie among all subdomains under the main domain

response.cookies[response.session_id_name]['domain'] = '.leonexus.nl'

# If you want two or more applications to share sessions, set masterapp
# to the name of the master application.

session.connect(request, response, masterapp="controlpanel")



I wonder whether I need both lines of code or just one of them, and whether
there is a specific order to place them in.


Kind regards,

Annet
Reply all
Reply to author
Forward
0 new messages