Gamas, Thanks for your suggestion. I guess the combination of setting a single cookie header + lenient cookie validation did the trick.
Regards Vish ------------------------------------------------------------------------------------------------------------------------------------------------------------------- SOMETIMES YOU NEED TO GO FAR, TO FIND WHAT IS CLOSEST TO YOU -----Original Message----- From: Sambaiah, Vishwas Sent: Wednesday, May 04, 2005 9:29 AM To: HttpClient User Discussion Subject: RE: Problem with Cookies Thanks for your suggestions. I really appreciate the quick responses. I shall try this tonight and let you know how it goes. Regards Vish ------------------------------------------------------------------------------------------------------------------------------------------------------------------- SOMETIMES YOU NEED TO GO FAR, TO FIND WHAT IS CLOSEST TO YOU -----Original Message----- From: Gamas Sugiarto [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 03, 2005 6:41 PM To: HttpClient User Discussion Subject: Re: Problem with Cookies Hi Vish, A lot of website out there set malformed cookies which will be rejected by CookiePolicy.BROWSER_COMPATIBILITY validation method. I had problem before when trying to login to Hotmail website. What I did to solve the problem was to create my own custom Cookie Spec class extending from org.apache.commons.httpclient.cookie.CookieSpecBase and implement a more lenient validate method. Also don't forget to set clientParams.setParameter("http.protocol.single-cookie-header", new Boolean(true)); to your HttpClientParams. Hope this helps. Gamas Sugiarto On 5/3/05 12:05 PM, "Sambaiah, Vishwas" <[EMAIL PROTECTED]> wrote: > Roland, > > Thanks for the response. My app listens to the port set on the browser proxy > settings and then delegates the request to the actual host. So I guess the > domain should be the actual host! > > > Regards > Vish > > ------------------------------------------------------------------------------ > ------------------------------------------------------------------------------ > ------- > > SOMETIMES YOU NEED TO GO FAR, TO FIND WHAT IS CLOSEST TO YOU > > > > -----Original Message----- > From: Roland Weber [mailto:[EMAIL PROTECTED] > Sent: Tuesday, May 03, 2005 11:49 AM > To: HttpClient User Discussion > Subject: Re: Problem with Cookies > > > Hello Vish, > > is your "web proxy server" configured as a proxy in the browser, > or are you pointing your browser directly to your web application, > which just happens to forward the requests someplace else? > > In the second case, you may have an issue with the cookie domain. > A cookie set for domain .yahoo.com will not be sent to a host > proxy.mydomain.wherever.it.is. Cookies can be set without a > domain, in which case the domain is taken from the host that > set the cookie. That would explain why some cookies work, while > others don't. > > hope that helps, > Roland > > > > > > > "Sambaiah, Vishwas" <[EMAIL PROTECTED]> > 03.05.2005 16:49 > Please respond to > "HttpClient User Discussion" > > > To > "HttpClient User Discussion" <[email protected]> > cc > > Subject > Problem with Cookies > > > > > > > Hello All, > > I am trying to write a small web proxy type application for a web > performance benchmarking tool. Though this application essentially is a > web proxy server, it additionally has logic for generating custom test > scripts etc due to which I cannot use off the shelf proxy server. I found > that HttpClient was a neat reusable component to plug into my application. > I have successfully integrated HttpClient component into my app, but I > bumped into issues with cookies. After initial research through the > archives of the mailing list, I realized that I should set the > CookiePolicy.BROWSER_COMPATIBILITY for most browsers to work. > > This solved most of my problems. However, I still have issues with cookies > for ex. when I try logging into Yahoo mail. When I enter my username and > password on the browser, the response page I get from the server is asking > em to check if my browser is enabled to accept cookies. I am not too sure > what is happening in the background but what I am sure is, the cookies > arent set properly between the server and client browser. > > I would really appreciate if someone point me in the right direction in > solving the cookie issue as I have hit a bottleneck. Thanks in advace for > helpful pointers. > > Regards > Vish > ------------------------------------------------------------------------------ > ------------------------------------------------------------------------------ > ------- > SOMETIMES YOU NEED TO GO FAR, TO FIND WHAT IS CLOSEST TO YOU > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] -- Gamas Sugiarto | Software Engineer | Evite 3731 Wilshire Blvd. Suite 300 | Los Angeles, Ca | 90010 http://www.evite.com --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
