question: public static String readCookieIgnoreSpecialCharacters ( HttpServletRequest request , String cookieName ) { String cs = request . getHeader ( "cookie" ) ; if ( cs == null ) return null ; int start = cs . indexOf ( cookieName ) ; if ( start < 0 ) return null ; cs = cs . substring ( start + 1 + cookieName . length ( ) ) ; int end = cs . indexOf ( ';' ) ; if ( end > 0 ) { cs = cs . substring ( 0 , end ) ; } return cs ; }
target:  Read all cookies from the request's 'cookie' header, and parse it based on Cookie Version 1. <p/>This method can resolve tomcat's bug in handling special characters in cookie (The cookie is maybe written by other applications).