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 3799] New: - Setting null cookie value throws exception
Date Mon, 24 Sep 2001 22:09:00 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=3799>.
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=3799

Setting null cookie value throws exception

           Summary: Setting null cookie value throws exception
           Product: Tomcat 4
           Version: 4.0 Final
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Critical
          Priority: Other
         Component: Catalina
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: bill@jivesoftware.com


The standard way to delete a cookie is to set the cookie's value to null then 
re-add the cookie to the response:

<%
    // Cookie test
    Cookie cookie = new Cookie("foo",null);
    // add cookie
    response.addCookie(cookie);
%>

This results in a NullPointerException because Tomcat tries to URLEncode a null 
value. The ability to delete a cookie is a critical necessity as it will 
prevent most webapps that use cookies from working correctly.

Mime
View raw message