You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@chemistry.apache.org by "Weigel, Achim" <ac...@sap.com> on 2011/10/17 10:28:51 UTC

Stable session id for a OpenCMIS server when using OpenCmis Workbench

Hello,

we are implementing an (Open)CMIS compliant server and need some kind of session concept for it. We are using the OpenCMIS Workench as client and tried out the following using the atompub binding:

We implemented and configured a CallContextHandler and tried to fetch the session id from the request:

String sessionId = request.getSession().getId();

Unfortunately the id is different for all requests.

Do you perhaps know how we could resolve this?

Thank you very much in advance and best regards,

Achim


RE: Stable session id for a OpenCMIS server when using OpenCmis Workbench

Posted by Jens Hübel <jh...@opentext.com>.
Hi Achim,

for the InMemory implementation I have a similar requirement. I would like to be able to cache the Acls a user has access to.

Would it make sense to provide a hash map in the server support package where you can attach information you want to keep for a "session". I don't have an exact design here in mind but something that uses a key based on ip address and user or a cookie if available. And somehow a way to clean this up (LRU, max size or something).

We should add the Servlet request to the call context to make this possible.

Would this help for your use case?

Jens


-----Original Message-----
From: Weigel, Achim [mailto:achim.weigel@sap.com] 
Sent: Montag, 17. Oktober 2011 10:39
To: dev@chemistry.apache.org
Subject: RE: Stable session id for a OpenCMIS server when using OpenCmis Workbench

Perhaps I should add that we are doing this in the method getCallContextMap(HttpServletRequest request) of our CallContextHandler.

-----Original Message-----
From: Weigel, Achim [mailto:achim.weigel@sap.com] 
Sent: Montag, 17. Oktober 2011 10:29
To: dev@chemistry.apache.org
Subject: Stable session id for a OpenCMIS server when using OpenCmis Workbench

Hello,

we are implementing an (Open)CMIS compliant server and need some kind of session concept for it. We are using the OpenCMIS Workench as client and tried out the following using the atompub binding:

We implemented and configured a CallContextHandler and tried to fetch the session id from the request:

String sessionId = request.getSession().getId();

Unfortunately the id is different for all requests.

Do you perhaps know how we could resolve this?

Thank you very much in advance and best regards,

Achim


Re: Stable session id for a OpenCMIS server when using OpenCmis Workbench

Posted by Florent Guillaume <fg...@nuxeo.com>.
I would be for encouraging client writers to use cookie support, it's
really the best way, cookies are designed to allow a server to
maintain sessions when using HTTP.
Anything else will be artificially constrained IMHO.

Florent


On Mon, Oct 17, 2011 at 12:40 PM, Florian Müller
<fl...@alfresco.com> wrote:
> Hi Achim,
>
> This has actually nothing to do with OpenCMIS.
> I assume your servlet engine sets a cookie to maintain the session. Since most CMIS client don't send that cookie back, each request looks like a new session and the servlet engine generates a new id.
> You could, of course, turn the cookie support in the OpenCMIS client on, but don't expect that other clients have that capability.
>
> CMIS is stateless. Applying state on the server side is rather difficult. Your only hint is probably the username or maybe the combination of the username and the IP address.
>
>
> Florian
>
>
> On 17/10/2011 09:38, Weigel, Achim wrote:
>> Perhaps I should add that we are doing this in the method getCallContextMap(HttpServletRequest request) of our CallContextHandler.
>>
>> -----Original Message-----
>> From: Weigel, Achim [mailto:achim.weigel@sap.com]
>> Sent: Montag, 17. Oktober 2011 10:29
>> To: dev@chemistry.apache.org
>> Subject: Stable session id for a OpenCMIS server when using OpenCmis Workbench
>>
>> Hello,
>>
>> we are implementing an (Open)CMIS compliant server and need some kind of session concept for it. We are using the OpenCMIS Workench as client and tried out the following using the atompub binding:
>>
>> We implemented and configured a CallContextHandler and tried to fetch the session id from the request:
>>
>> String sessionId = request.getSession().getId();
>>
>> Unfortunately the id is different for all requests.
>>
>> Do you perhaps know how we could resolve this?
>>
>> Thank you very much in advance and best regards,
>>
>> Achim
>>
>
>



-- 
Florent Guillaume, Director of R&D, Nuxeo
Open Source, Java EE based, Enterprise Content Management (ECM)
http://www.nuxeo.com   http://www.nuxeo.org   +33 1 40 33 79 87

Re: Stable session id for a OpenCMIS server when using OpenCmis Workbench

Posted by Florian Müller <fl...@alfresco.com>.
Hi Achim,

This has actually nothing to do with OpenCMIS.
I assume your servlet engine sets a cookie to maintain the session. Since most CMIS client don't send that cookie back, each request looks like a new session and the servlet engine generates a new id.
You could, of course, turn the cookie support in the OpenCMIS client on, but don't expect that other clients have that capability. 

CMIS is stateless. Applying state on the server side is rather difficult. Your only hint is probably the username or maybe the combination of the username and the IP address. 


Florian


On 17/10/2011 09:38, Weigel, Achim wrote:
> Perhaps I should add that we are doing this in the method getCallContextMap(HttpServletRequest request) of our CallContextHandler.
> 
> -----Original Message-----
> From: Weigel, Achim [mailto:achim.weigel@sap.com] 
> Sent: Montag, 17. Oktober 2011 10:29
> To: dev@chemistry.apache.org
> Subject: Stable session id for a OpenCMIS server when using OpenCmis Workbench
> 
> Hello,
> 
> we are implementing an (Open)CMIS compliant server and need some kind of session concept for it. We are using the OpenCMIS Workench as client and tried out the following using the atompub binding:
> 
> We implemented and configured a CallContextHandler and tried to fetch the session id from the request:
> 
> String sessionId = request.getSession().getId();
> 
> Unfortunately the id is different for all requests.
> 
> Do you perhaps know how we could resolve this?
> 
> Thank you very much in advance and best regards,
> 
> Achim
> 


RE: Stable session id for a OpenCMIS server when using OpenCmis Workbench

Posted by "Weigel, Achim" <ac...@sap.com>.
Perhaps I should add that we are doing this in the method getCallContextMap(HttpServletRequest request) of our CallContextHandler.

-----Original Message-----
From: Weigel, Achim [mailto:achim.weigel@sap.com] 
Sent: Montag, 17. Oktober 2011 10:29
To: dev@chemistry.apache.org
Subject: Stable session id for a OpenCMIS server when using OpenCmis Workbench

Hello,

we are implementing an (Open)CMIS compliant server and need some kind of session concept for it. We are using the OpenCMIS Workench as client and tried out the following using the atompub binding:

We implemented and configured a CallContextHandler and tried to fetch the session id from the request:

String sessionId = request.getSession().getId();

Unfortunately the id is different for all requests.

Do you perhaps know how we could resolve this?

Thank you very much in advance and best regards,

Achim