hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Roland Weber <ROLWE...@de.ibm.com>
Subject Re: Persistent connections
Date Fri, 03 Feb 2006 06:22:26 GMT
Hi Juan,

"Juan Luis de Amaya Robles" <JuanLuisdeAmaya@concatel.com> wrote on 
02.02.2006 19:48:50:

> I have two urls to call (PHP pages). One sets a language variable in
> session. Another returns data depending on the session var.
> 
> i think, i need stablish persistent connection to connect web pages with
> session data.

No. If connections were persistent, you wouldn't need a session.

> When i call the first one url, it returns a cookie with a PHPSESSID
> (it's a php). ok.
> I understand that cookie is sended when I call the second one url, but i
> get a incorrect second page, well, the language is not correct.
> This is because the session is incorrect. I think.

Quite possible. Make sure you use the same HttpClient object for both 
requests.
Check out our cookie guide to see whether your problem is addressed there:

http://jakarta.apache.org/commons/httpclient/cookies.html

> When i print the "isPersistent()" method is returned false. I must
> configure anything else?
> where the cookie is stored?

HttpClient never stores persistent cookies anywhere but in memory.
By default, they are put into the state of the HttpClient object.
Make sure you use the same HttpClient object for both request. Don't
pass an explicit state to the second request. Try the "browser
compatibility" cookie spec, since some servers send domain names
without a leading dot.

hope that helps,
  Roland


---------------------------------------------------------------------
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