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
I finally found the solution :
HttpHeaders headers = new HttpHeaders(); headers.add("Set-Cookie","key="+"value"); ResponseEntity.status(HttpStatus.OK).headers(headers).build();