public Result discard ( String name ) { Cookie cookie = getCookie ( name ) ; if ( cookie != null ) { cookies . remove ( cookie ) ; cookies . add ( Cookie . builder ( cookie ) . setMaxAge ( 0 ) . build ( ) ) ; } else { cookies . add ( Cookie . builder ( name , "" ) . setMaxAge ( 0 ) . build ( ) ) ; } return this ; }
Discards the given cookie . The cookie max - age is set to 0 so is going to be invalidated .