title: An invalid domain.test.com was specified for this cookie
body: <p>Why am I not able to set wildcard domain cookie in java?</p>
  
  <pre><code>Cookie cookie = new Cookie("id", "c");
  cookie.setDomain(".test.com");
  response.addCookie(cookie);
  response.sendRedirect(redirect);
  return new ResponseEntity&lt;&gt;(response, HttpStatus.SEE_OTHER);
  </code></pre>
  
  <p>An invalid domain [.test.com] was specified for this cookie</p>
  
  <p>Thanks</p>