[web2py] Share sessions not working

2021-09-11 Thread dirman
In my case, sessions are not shared in my two apps main and sub domain



session.connect(request, response,masterapp='test', db=db)

response.cookies[response.session_id_name]['domain'] = '.test.com' 


routers = dict(
  BASE=dict(
default_controller='default',
default_function='index',
domains={
'test.com':'redirect_to_www_test',
'www.test.com':'test',
'manage.test.com ': 'manage_test'
},
  )
)


Any help is appreciated

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/8002c755-266b-4330-ba25-c840fedf55bbn%40googlegroups.com.


[web2py] Share sessions

2020-10-13 Thread 'Annet' via 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

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/57ec480c-042d-4679-93ee-4460b633fbdan%40googlegroups.com.