Got the following situation:
- Two applications released as lambda functions (A and B), each application in this scenary have his own web2py version, served with the same domain name behind an nginx proxy, for example A (
example.com) and B (
example.com/path_to_b).
- i wanted that B uses A as a CAS provider.
- both using the same REDIS server for sessions (the exact same settings in both applications/web2py instances):
from gluon.contrib.redis_utils import RConn
from gluon.contrib.redis_cache import RedisCache
from gluon.contrib.redis_session import RedisSession
redis_conection = RConn(
host=configuration.get('redis.host'),
port=configuration.get('redis.port'))
session.connect(request, response, db=RedisSession(redis_conection))
B keeps redirecting me to the A login page, after some heavy debugging I realized that the problem could be the sessions and tested using sessions in database for B and well it worked fine.
So the question is: two, separate, web2py instances can't share the same redis server ? i mean, in my case is not a lambda function with 2 applications, each application in this scenary have his own web2py version - for reasons outside this discussion - and i wished to reuse the already deployed redis server. Is there some kind of conflict betwen each web2py instance?