Why is OC4J changing the name of my cookie?
581731Sep 22 2008 — edited Sep 22 2008My application includes a servlet filter. In that filter, I am setting a cookie to track some data back on the client. The name of the cookie is "ibms_user" and I post a code snippet below. The problem is that, when it gets back to the browser, the name has been changed to $OC4J_ENCODED_ibms_user.
Here is the code snippet:
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
//Convert the Servlet objects to http objects
HttpServletResponse res = (HttpServletResponse) response;
res.addCookie(createIbmsCookie(req.getUserPrincipal().getName(), false));
HttpSession session = req.getSession(true);
.
. (other, irrelevant code)
.
.
.
Cookie c = new Cookie("ibms_user", "some value");
c.setPath("/");
c.setDomain(".jpl.nasa.gov");
c.setMaxAge(-1);
//Add the cookie to the response.
res.addCookie(c);
//Pass on to the next request
chain.doFilter(req,res);
}
There is a known issue with the code above, in that the cookie is getting set before the call to doFilter(). Regardless, I don't understand why the name is being changed.
To complete the picture, you should know that the application is setting up to authenticate against OID and uses OracleSSO (at the web server level, not javasso). The version of OC4J is 10.1.3.3.1 on Solaris 9 (64 bit SPARC).
Thanks for any hints,
Ara