public String validateCookieName ( String cookieName , boolean quiet ) { if ( cookieName == null || cookieName . length ( ) == 0 ) { if ( ! quiet ) { Tr . error ( tc , "COOKIE_NAME_CANT_BE_EMPTY" ) ; } return CFG_DEFAULT_COOKIENAME ; } String cookieNameUc = cookieName . toUpperCase ( ) ; boolean valid = true ; for ( int i = 0 ; i < cookieName . length ( ) ; i ++ ) { String eval = cookieNameUc . substring ( i , i + 1 ) ; if ( ! validCookieChars . contains ( eval ) ) { if ( ! quiet ) { Tr . error ( tc , "COOKIE_NAME_INVALID" , new Object [ ] { cookieName , eval } ) ; } valid = false ; } } if ( ! valid ) { return CFG_DEFAULT_COOKIENAME ; } else { return cookieName ; } }
reset cookieName to default value if it is not valid