[ https://issues.apache.org/jira/browse/CMIS-1082?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16957581#comment-16957581 ]
Ernesto Revilla commented on CMIS-1082: --------------------------------------- The cookiejar must load the cookies using the load method and after each get and post method I just save the cookies again. So I don't do anything special. I just use the file to share the cookies between several processes. If the question is if there is a mechanism to make the write operation thread / multi-process save, then the answer is, no, still it's not. (In my case, may be surrounding the write operation with try/except would be enough.) > error in clustered deployments, 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 > Priority: Major > > 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)