title: Getting cookie in servlet
body: <p>I'm trying to get cookie in servlet using</p>
  
  <pre><code>Cookie[] cookie = request.getCookies();
  </code></pre>
  
  <p>but <code>cookie</code> is always <code>null</code>.</p>
  
  <p>So I set them from another servlet and they appear in browser preferences.</p>
  
  <pre><code>Cookie cookie = new Cookie("color", "cyan");
  cookie.setMaxAge(24*60*60);
  cookie.setPath("/");
  response.addCookie(cookie);
  </code></pre>
  
  <p>I don't understand what's wrong?</p>