You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by oh <wa...@sm.sony.co.jp> on 2002/03/25 11:57:06 UTC

keyword of "domain" in Cookie

Hi,

I am developing the server program for login process,
I set the cookie with "domain" and "path", but the keyword 
is not the format that the client expected.

Cookie were set by this way :
        Cookie cookie = new Cookie("ticket", value);
        cookie.setMaxAge(age);
        cookie.setDomain("test.hostname.xxx");
        cookie.setPath("/");
I hope it will be as the following format in the head of response:
Set-Cookie: ticket=53vt5whj61.ajp12tis21;domain=test.hostname.xxx;expires=Sat, 12-Apr-2070 13:56:49 GMT;path=/

but all of the keywords are in capital, 
Set-Cookie: ticket=53vt5whj61.ajp12tis21;Domain=test.hostname.xxx;Expires=Sat, 12-Apr-2070 13:56:49 GMT;Path=/

The client program received this by the response and set "Domain" as another cookie in the next request,
But tomcat doesnt't accept it, an exception occured:
--------------------------------------------
java.lang.IllegalArgumentException: Cookie name Domain is a reserved token

For some reason the client cannot be changed, does any one know how to solve this problem?
I refered the documents about HTTP Cookie, the keyword is "domain" , not "Domain".
Why it was written as "Domain" by Tomcat?

Any help will be appreciate.

Regards,
Huimin Wang





--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>