axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Gainty <mgai...@hotmail.com>
Subject RE: Cookie getting overwritten when client connects to multiple servers.
Date Tue, 12 Mar 2013 09:52:10 GMT
MG> options.setManageSession(true);
 
setManageSession
public void setManageSession(boolean manageSession)
Set session management enabled state. When session management is enabled, the engine will
automatically send session data (such as the service group id, or HTTP cookies) as part of
requests.
Parameters:
manageSession - true if enabling sessions
 
you are specifically requesting your cookies be session scoped.. (not request or application)

 
http://axis.apache.org/axis2/java/core/api/org/apache/axis2/client/Options.html#setManageSession(boolean)

Martin-

  


> Date: Tue, 12 Mar 2013 02:18:07 -0700
> From: santhoshs123@gmail.com
> To: java-dev@axis.apache.org
> Subject: Re: Cookie getting overwritten when client connects to multiple servers.
> 
> After more investigation found that we can get rid of this by setting unique
> cookie names for each of the servers. If we set unique cookie names, axis
> sends all those cookies to each server along with every API call. This
> solution does not look that clean and if there are huge number of
> servers(lets say 500) to which our client is connecting to at any given
> point in time then we will end up having(and sending) 500 cookies along with
> each API call(if not restricted).
> 
> Later with more investigation found that Axis2 provides us a feature to
> avoid overwriting of cookies with same names when connected to multiple
> servers by setting the custom cookie id. By going through Axis source
> code(AbstractHTTPSender.java), I think Axis tries to extract the cookie with
> name Constants.CUSTOM_COOKIE_ID(set using setProperty) from the response and
> attaches it to ServiceContext so that the next request to that server will
> be attached with cookie extracted in previous response.
> 
> I tried doing this but was not successful in getting the expected results,
> still the cookies were getting overwritten. Hope and wish that I am doing
> some thing wrong here, below is how I set Constants.CUSTOM_COOKIE_ID
> 
> ServiceClient serviceClient = stub._getServiceClient()
> Options options = serviceClient.getOptions();
> options.setManageSession(true);
> options.setTimeOutInMilliSeconds(timeoutInMilliseconds);
> options.setProperty(Constants.CUSTOM_COOKIE_ID, "XXXSESSIONID");
> serviceClient.setOptions(options);
> 
> After this I expect Axis to handle the cookie overwriting but does not seem
> like that. I feel there is something wrong the way I am setting the
> property.
> 
> Guys, please let me know your views on this. I am completely stuck with this
> problem.
> 
> Note: we are using scope=application and that cannot be changed.
> 
> 
> 
> --
> View this message in context: http://axis.8716.n7.nabble.com/Cookie-getting-overwritten-when-client-connects-to-multiple-servers-tp111918p111999.html
> Sent from the Axis Java - Dev mailing list archive at Nabble.com.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
> For additional commands, e-mail: java-dev-help@axis.apache.org
> 
 		 	   		  
Mime
View raw message