struts2 losing cookies when calling other action
after creating several cookies in one action and placing them on the
response, when i try to access those cookies in another action the request
is blank. here's the code that created the cookies(portion of code) :
Cookie cookie;
cookie = new Cookie("cookieUserId", cookieUserId);
cookie.setPath(getText("cp.cookieDirectory"));
if (getText("cp.cookieDomain") != null
&& getText("cp.cookieDomain").length() > 0) {
cookie.setDomain(getText("cp.cookieDomain"));
}
response.addCookie(cookie);
cookie = new Cookie("iwif_web_sso_timer",
getText("cp.cookieSessionIdleTimeout"));
cookie.setPath(getText("cp.cookieDirectory"));
if (getText("cp.cookieDomain") != null
&& getText("cp.cookieDomain").length() > 0) {
cookie.setDomain(getText("cp.cookieDomain"));
}
response.addCookie(cookie);
here is the code (in another action) that should retrieve the cookies, yes
the action is implementing ServletResponseAware and ServletRequestAware:
Cookie[] cookies = request.getCookies();
when i inspect what is returned to cookies, the cookies array is blank.
WHY? any help would be much appreciated. thankx!
No comments:
Post a Comment