You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2002/02/08 16:34:52 UTC
DO NOT REPLY [Bug 6331] New: -
Cannot add more than one cookie
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=6331>.
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=6331
Cannot add more than one cookie
Summary: Cannot add more than one cookie
Product: Tomcat 4
Version: 4.0.1 Final
Platform: PC
OS/Version: Other
Status: NEW
Severity: Major
Priority: Other
Component: Catalina
AssignedTo: tomcat-dev@jakarta.apache.org
ReportedBy: paul.bowler@platinata.com
Adding additional cookies (i.e. more than one) to the servlet response sets all
the previously added cookies to the same name/value pairs.
The trace I get back from a dummy client is:
<- Content-Type: text/html
<- Date: Fri, 08 Feb 2002 15:04:58 GMT
<- Server: Microsoft-IIS/5.0
<- Connection: close
<- Set-Cookie: JSESSIONID=E4C0F47603F4D710D558870208206740;Path=/
<- Set-Cookie: JSESSIONID=E4C0F47603F4D710D558870208206740;Path=/
<- Set-Cookie: JSESSIONID=E4C0F47603F4D710D558870208206740;Path=/
from code:
<clip>
Session session = request.getSession(true);
response.addCookie(new Cookie("fred", "wilma"));
response.addCookie(new Cookie("barney", "betty"));
<clip>
It would appear that the 'request.getSession(true)' is added as a cookie last
and the previous 2 cookies are altered.
Removing the session creation call gives the follow trace:
<- Content-Type: text/html
<- Date: Fri, 08 Feb 2002 15:14:02 GMT
<- Server: Microsoft-IIS/5.0
<- Connection: close
<- Set-Cookie: barney=betty
<- Set-Cookie: barney=betty
This follows the pattern that the last created cookie alters all previous
cookies.
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>