Unable to add a Cookie using response.addCookie
<p>I am trying to add cookie to cookies, but on trying to get its value its coming as null.</p>

<pre><code>String gsidCookieName = "GlobalSessionID_26";
String gSIDCookie = null;
gSIDCookie = CookieHelper.getCookieValue(request, gsidCookieName);

if(null!= gSIDCookie){  
logger.info("gSIDCookie is not null and value is " + gSIDCookie);
}
else{
logger.info("gSIDCookie is null and value is " + gSIDCookie);
String status = "test";
Cookie cookie = new Cookie (gsidCookieName,status);
logger.info("\n Session id set in cookie in fios ::" +status);
cookie.setMaxAge(180);
cookie.setPath("/");
cookie.setDomain(".mydomain.com");
cookie.setSecure(false);
response.addCookie(cookie);
}
</code></pre>

<p>On first time accessing my application, its going inside "else" condition above and adding the cookie.
But on accessing second time, its not going to "if" condition and value is coming as null.
Please help me why its not getting stored in cookies.</p>
