tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 9590] - cookies stop sending to browser after nested loop
Date Mon, 18 Nov 2002 15:47:25 GMT
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=9590>.
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=9590

cookies stop sending to browser after nested loop





------- Additional Comments From Brian.Ewins@btinternet.com  2002-11-18 15:47 -------
Try testing if the response is committed before setting that last cookie,
eg <% if (response.isCommitted()) { System.err.println("train has left the
station"); } %>

If you'd managed to push 256 bytes of whitespace (for example) into the JSP
during that loop then you'll cause the response to commit, so you can no longer
set a 'Set-Cookie' header (or any other header). Also, because the second
addCookie is always adding the same thing, you might not be seeing the real
point that cookies fail, its more likely during the loop than afterwards - try
setting it to a counter instead. 

Finally, if the loop has > 19 iterations, the /browser/ will cause you a
problem. See
http://jakarta.apache.org/tomcat/tomcat-4.0-doc/servletapi/javax/servlet/http/Cookie.html,
 - browsers only have to support 20 cookies per server. You'd have created 20
Set-Cookie headers and the browser would ignore the rest.

--
To unsubscribe, e-mail:   <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-dev-help@jakarta.apache.org>


Mime
View raw message