question: static String pathToCookiePath ( String path ) { if ( path == null ) { return "/" ; } int lastSlash = path . lastIndexOf ( '/' ) ; return path . substring ( 0 , lastSlash + 1 ) ; }
target:  Returns a cookie-safe path by truncating everything after the last "/". When request path like "/foo/bar.html" yields a cookie, that cookie's default path is "/foo/".