Hi there,
I need to make few apps that will share sessions.
For testing purposes, i have applications "shared", "app1" and "app2".
In application "shared", i have:
db = DAL('sqlite://storage.sqlite')
session.connect(request, response, db = db)
(...)
in applications "app1" and "app2" i have:
db = DAL('sqlite://../../shared/databases/storage.sqlite')
session.connect(request, response, db = db, masterapp = 'shared')
(...)
auth.define_tables(migrate = False)
(...)
folders app1/databases and app2/databases do not have any databases,
which means they use database from "shared". Did that part right :)
The funny part starts here:
If I register new user via application "shared", I cannot login from
"app1" nor "app2", only from app "shared". Once I log in application
"shared", I'm logged in all three applications.
If I register new user via applicaton "app1", i cannot login from
"shared", but can from both "app1" and "app2". After loggind, the same
situation as above, I'm logged in all three applications.
I guess i won't have any headaches with this one, because application
"shared" will be 'hidden' and users will not register accounts using
registration form on that app. It should be enough, but that does not
solve the problem. I created another application "app3", and managed
to login to all accounts which I made from "app1" or "app2". Could not
login to accounts from "shared" (just wanted to make sure I got it
right).
I don't know if this is a web2py bug or a feature, and if it is a
feature, why & howto fix (if possible).
p.s. I used applications generated by framework, i edited only the
lines mentioned above.