Mantis - Resin
Viewing Issue Advanced Details
3897 major always 02-19-10 22:09 01-17-11 12:05
ykim  
ferg  
normal  
closed 3.1.6  
fixed  
none    
none 4.0.15  
0003897: resin doesn't parse cookie value that is space delimited
We are migrating legacy application from websphere to resin. The application is using cookie value that is space delimited - let's say "A B C"

With resin's servlet implementation, when you invoke getCookies() and retrieve the value, it only gets "A" and the remaining part of the value gets truncated.

I don't recall seeing any restrictions on the format of a value. I'm adding a sample jsp code that simulates it in the additional information.
<%@ page import="javax.servlet.http.*" %>
<%@ page import="org.apache.commons.lang.StringUtils" %>

<script lang="javascript">
   //document.cookie = 'mycookie' + "=" + escape('a b c');
   document.cookie = 'mycookie' + "=" + 'a b c';
</script>

<%
        Cookie[] cookies = request.getCookies();

        out.println("cookie length = " + cookies.length);
        if (cookies != null) {
            for (int i = 0; i < cookies.length; i++) {
                String value = cookies[i].getValue();
                out.println(cookies[i].getName() + " = " + value);
            }   
        }   

        String[] cookieData = StringUtils.split(cookies[1].getValue(), ' ');
        for (int i = 0; i < cookieData.length; i++ ) {
            out.println("cookie value = " + cookieData[i]);
        }
%>


Notes
(0004944)
ferg   
01-17-11 12:05   
server/010y