chemistry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ernesto Revilla (Jira)" <j...@apache.org>
Subject [jira] [Created] (CMIS-1082) error in clustered deplomentos, cmislib doesn't use Alfresco JSESSION cookies
Date Tue, 22 Oct 2019 15:46:00 GMT
Ernesto Revilla created CMIS-1082:
-------------------------------------

             Summary: error in clustered deplomentos, cmislib doesn't use Alfresco JSESSION
cookies
                 Key: CMIS-1082
                 URL: https://issues.apache.org/jira/browse/CMIS-1082
             Project: Chemistry
          Issue Type: Improvement
          Components: python-cmislib
    Affects Versions: cmislib 0.6.0
         Environment: Alfresco Enterprise 5.2.4, two repo nodes, same DB, one SOLR deployment.
            Reporter: Ernesto Revilla


When using clustered deployments, 404 errors can appear when load balancer is only configured
to use sticky sessions based on JSESSIONID cookie.

 

It would be good to have cmislib to support cookies.

For 0.5.1 I could use a cookiejar in {{cmislib/net.py}}, like this:

 

{{
 from cookielib import LWPCookieJar
 from urllib2 import  HTTPCookieProcessor
 ...
 class RESTService(object): 
 ... 
     def __init__(self):
         ...
         cookiejar = LWPCookieJar('/tmp/alfresco-cookies.txt')
         try:
             cokiejar.load(ignore_discard=True, ignore_expires=True)
         except IOError:
             pass}}
                   self.cookiejar = cookiejar

    def get(self, 
 ...
         opener = build_opener(SmartRedirectHandler(),
                               DefaultErrorHandler(),
                               ContextualBasicAuthHandler(passwordManager),
                               HTTPCookieProcessor(self.cookiejar))
         res = opener.open(request)
         self.cookiejar.save(ignore_discard=True, ignore_expires=False)
         return res
 }}
  

I use a file as cookiejar because I have to share the cookies between several processes.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Mime
View raw message