public CookieBuilder withName ( String name ) { Mutils . notNull ( "name" , name ) ; boolean matches = name . matches ( "^[0-9A-Za-z!#$%&'*+\\-.^_`|~]+$" ) ; if ( ! matches ) { throw new IllegalArgumentException ( "A cookie name can only be alphanumeric ASCII characters or any of \"!#$%&'*+-.^_`|~\" (excluding quotes)" ) ; } this . name = name ; return this ; }
Sets the name of the cookie .