title: Java setting cookie on root path
body: <p>I have a login page at <code>myhost:8080/auth/login</code> after I logged in I set a cookie by my home controller class which is at <code>'myhost:8080/home/</code></p>
  
  <p>I am setting my cookie like this</p>
  
  <pre><code> Cookie myCookie =  new Cookie("__JSSESSIONID", request.getSession().getId());
   myCookie.setPath("/");
   response.addCookie(myCookie);
  </code></pre>
  
  <p>but when I see it via firebug, it shows me the path "/home". I want to set cookie on root path so that can ready from other places.</p>