hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ryan Wynn <rw...@us.ibm.com>
Subject Transferring Cookies
Date Fri, 26 Aug 2005 20:26:43 GMT
I have a portal application and one of the portlets is just 1 jsp page 
with an embedded applet.  This applet uses java's standard 
HttpUrlConnection class to talk to a servlet.  The thing is when I make a 
HttpUrlConnection within the applet I can see that the connection has 
inherited the cookies from the portal.  Specifically JSESSIONID, etc. This 
is necessary because my servlet is configured with security and somehow 
sending the cookies allows the request to pass BASIC authentication and 
the servlet to link the getRemoteUser of the servlet request to the userId 
of whomever logged into portal.

Is this something special that the j2se HttpConnection is doing?  The 
reason that I ask is because I also use HttpClient within the applet. 
However, it would not propogate the cookies to the servlet.  I had to 
provide a dirty workaround.  I retrieve the cookies using 
HttpUrlConnection and then set them explicity on my HttpClient.

Does anyone know why I am getting my cookies for free with Sun's 
HttpUrlConnection and not with HttpClient?  Oh, I also tried using each of 
the Cookie policies with HttpClient and none of them caused the cookies to 
be inherited.

Ryan
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message