You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by Oleg Kalnichevski <o....@dplanet.ch> on 2003/02/18 18:08:51 UTC

Re: Cookies: need more convenience

Odi,

I have been thinking your request over for quite some time already. I
tend to lean toward providing this kind of functionality as a part of
URI related utilities (with URIUtil being on my mind) rather than from
the Cookie class. I am a bit reluctant to tightly couple Cookie class
with URI or URL classes just because of a few convenience methods.

Let me know what you think about it

Cheers

Oleg


On Mon, 2002-12-16 at 18:03, Ortwin Glück wrote:
> I am missing a simple way to generate the domain string for a Cookie 
> from an URL.
> 
> I would like to have something like:
> URL url = new URL("http://jakarta.apache.org/");
> Cookie cookie = new Cookie(Cookie.getDomain(url, 2), COOKIE_NAME, 
> "myvalue");
> 
> Cookie.getDomain(url, 2) would then return .apache.org (2 dots).
> Cookie.getDomain(url, 3) would then return .jakarta.apache.org (3 dots).
> 
> Odi
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
>