tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "yhs@mimic.onesourcecorp.com" <...@mimic.onesourcecorp.com>
Subject bug with tomcat 3.2b2 and/or blackdown jdk 1.2.2FCS ????
Date Tue, 07 Jan 1997 01:58:03 GMT
Hi,
  When i do a set cookie as follows :

session = request.getSession(true);
Cookie[] cookies = request.getCookies();
Cookie authCookie = new Cookie("abc", "def");

and then i do :

int i=0;
for(i=0; i < cookies.length; i++) {
Cookie thisCookie = cookies[i];
thisCookie.setValue(null);
thisCookie.setMaxAge(0); } // should be enough but...
String[] names = session.getValueNames(); 
if (names != null){ for (i=0; i< names.length; i++) 
{session.removeValue(names[i]);} } // do it again to be sure.

and then do :
 
cookies = request.getCookies();
for(i=0; i<cookies.length; i++) {   
String n = cookies[i].getName();
if( n != null && n.equals("abc") ) {
if (cookies[i].getValue()!=null)
{ System.err.println("Error. ");}  

in 3 different servlets, one after the other, the cookie still remains
with the old value. this is with both netscape 4.73 and mozilla M17.

This works correctly only with tomcat 3.1 and jdk 1.2.2RC4 (blackdown).
It doesnt work with jdk 1.2.2FCS and tomcat 3.2b2. :(
since suns jdk crashes for me, im stuck with blackdown...

Note that this bug is pretty serious if youre using cookies to write to
tables in a database. overwritten data etc. not good.
Thanks.
-Ys-
yhs@mimic.onesourcecorp.com


Mime
View raw message