On Tue, 2011-04-26 at 14:48 -0400, Bill Speirs wrote: > Does the http-core library have a class for generating "server"cookies? > > I've found all of the documentation for "client" cookies > (http://hc.apache.org/httpcomponents-client-ga/httpclient/apidocs/org/apache/http/cookie/package-summary.html) > however, I cannot seem to find anything for server cookies. Basically, > I want to create some type of cookie object, set all of the attributes > (domain, path, etc) and then call toString on it to generate the > appropriate Set-Cookie header string. >
Bill HttpCore module is meant to provide only low level HTTP transport components. Client side cookie components are part of HttpClient module, not HttpCore. For historical, mainly political, reasons HttpComponent project was restricted from developing server side code which could be seen as overlapping or even competing with other Apache projects. This restriction probably no longer makes any sense, so given enough interest such components could be developed, but there is simply not enough resources to do so. > Is the intent to manually construct such cookies and set them as a > header in an HttpResponse? Why doesn't HttpResponse provide a method > for setting cookies? For that matter, why doesn't HttpRequest provide > a method for easily extracting cookies (beyond manually parsing the > headers)? > Mainly because there are different cookie standards and different ways of parsing and formatting cookie headers. Hope this makes things somewhat clearer. Cheers Oleg --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
