I am implementing REST API endpoints using spring mvc. I am trying to send back a HTTP response with a cookie value. This is the equivalent of what I need
Alternatively you can use
HttpHeaders headers = new HttpHeaders(); headers.add(HttpHeaders.COOKIE, cookie-name + "=" + cookie value); ResponseEntity.status(HttpStatus.OK).headers(headers).build();