hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrea Sodomaco" <and...@sodomaco.it>
Subject R: session maintenance with two different HttpClient objects
Date Tue, 24 May 2005 14:35:32 GMT
Hi, 
Try 
	obj2.setState(obj1.getState());

can it help you?

Andrea Sodomaco


-----Messaggio originale-----
Da: Naresh Agarwal [mailto:naresh_iitd@yahoo.com] 
Inviato: lunedì 23 maggio 2005 15.32
A: httpclient-user@jakarta.apache.org
Oggetto: session maintenance with two different HttpClient objects

Hi 
 
I'm using HttpClient library for writing a specialized http client.
 
Let's say I have two instances of HttpClient object obj1 and obj2, which
communicate with same application running in web server. This
application provide two operations - "login" and "getDetails", which
need session maintenance using cookies. 
 
I am using obj1 and obj2 as follows - 
 
1. Call "login" operation using obj1 and extract the cookie from the
response.
2. Call "getDetails" operation using obj2  after setting cookie
extracted in step 1.
 
But my "getDetails" fails saying that login is required. However, if I
use obj1 in step 2, it works fine.
 
Basically, I've a special requirement to use *two different* instances
of HttpClient to communicate with same web service (which needs session
maintenance).
 
Am I missing something? Does session maintenace works only if all the
operations are called using same HttpClient object?
 
Any help will be greatly appreciated.
 
thanks & regards,
Naresh Agarwal

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-user-help@jakarta.apache.org


Mime
View raw message