You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by bu...@apache.org on 2003/10/15 16:25:36 UTC
DO NOT REPLY [Bug 23839] New: -
cookies aren't working?
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23839>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23839
cookies aren't working?
Summary: cookies aren't working?
Product: Commons
Version: 2.0 Beta 2
Platform: PC
OS/Version: Windows XP
Status: NEW
Severity: Major
Priority: Other
Component: HttpClient
AssignedTo: commons-httpclient-dev@jakarta.apache.org
ReportedBy: tom@tbee.org
I'm trying to use HttpClient to recreate a request that I stored. Important for
this request is that the cookies that were part of the original request, are
present.
The cookies are set, because the original cookie does not have a domain (null),
and I get a warning "WARNING: Invalid cookie state: domain not specified".
But when I examine the resulting request there cookies are not present.
How comes?
// add the cookies
lHttpClient.getState().setCookiePolicy
(CookiePolicy.COMPATIBILITY);
for (int i = 0; i < iCookies.size(); i++)
{
javax.servlet.http.Cookie lCookie =
(javax.servlet.http.Cookie)iCookies.get(i);
org.apache.commons.httpclient.Cookie lHttpCookie = new
org.apache.commons.httpclient.Cookie(lCookie.getDomain(), lCookie.getName(),
lCookie.getValue());
lHttpClient.getState().addCookie( lHttpCookie );
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-httpclient-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-httpclient-dev-help@jakarta.apache.org