You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Bryan Kearney <bk...@redhat.com> on 2009/03/23 16:14:47 UTC

Get the session ID on the client side

I have a client which is set up to use sessions using the following code:

((BindingProvider) 
proxy).getRequestContext().put(BindingProvider.SESSION_MAINTAIN_PROPERTY, 
true);

Is there any way to get the session ID / cookie back from the provider? 
I looked at the response conext and it is not in there?

Thanks!

-- bk



Re: Get the session ID on the client side

Posted by Bryan Kearney <bk...@redhat.com>.
Daniel Kulp wrote:
> 
> You PROBABLY could get it if you grab the HTTP_RESPONSE_HEADER things from the 
> response context and parse the cookie things yourself.   That's one way to do 
> it.

I looked there, but did not see an http response header in the object. I 
will dig around as you suggest below.

> 
> The HTTPConduit maintains the sessions cookies.   Thus, the other way would be 
> to do:
> 
> HTTPConduit con = (HTTPConduit)ClientProxy.getClient(proxy).getConduit();
> con.getCookies()
> 
> which will return all the cookies.
> 
> Dan
> 
> 
> On Mon March 23 2009 11:14:47 am Bryan Kearney wrote:
>> I have a client which is set up to use sessions using the following code:
>>
>> ((BindingProvider)
>> proxy).getRequestContext().put(BindingProvider.SESSION_MAINTAIN_PROPERTY,
>> true);
>>
>> Is there any way to get the session ID / cookie back from the provider?
>> I looked at the response conext and it is not in there?
>>
>> Thanks!
>>
>> -- bk
> 


Re: Get the session ID on the client side

Posted by Daniel Kulp <dk...@apache.org>.

You PROBABLY could get it if you grab the HTTP_RESPONSE_HEADER things from the 
response context and parse the cookie things yourself.   That's one way to do 
it.

The HTTPConduit maintains the sessions cookies.   Thus, the other way would be 
to do:

HTTPConduit con = (HTTPConduit)ClientProxy.getClient(proxy).getConduit();
con.getCookies()

which will return all the cookies.

Dan


On Mon March 23 2009 11:14:47 am Bryan Kearney wrote:
> I have a client which is set up to use sessions using the following code:
>
> ((BindingProvider)
> proxy).getRequestContext().put(BindingProvider.SESSION_MAINTAIN_PROPERTY,
> true);
>
> Is there any way to get the session ID / cookie back from the provider?
> I looked at the response conext and it is not in there?
>
> Thanks!
>
> -- bk

-- 
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog