jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Miguel" <varg...@utilibyte.com>
Subject setURL + addCookie bug?
Date Wed, 21 Feb 2007 21:35:03 GMT
When I use both setURL and addCookie my servlet does not see the cookie.  Is
this a bug in Cactus?  Could someone else try to replicate it?

Here's my beginXXX test:

    public void beginGetContent(WebRequest webRequest) {
       	webRequest.setURL("localhost", "/xmlserver", "/rest/getcontent",
"/5234", "");
            webRequest.addCookie(new Cookie("localhost","SESSID",SID));

I need to add /5234 to the URL I send my servlet located at
/rest/getcontent.  I also need to add a cookie.  When I do both of these the
servlet does not see the cookie.  When I don't setURL the servlet does see
the cookie.

I was thinking this was a problem with the security domain of the cookie,
which does seem to be enforced (by cactus?).  My servlet is actually running
on localhost:8080, so I tried putting localhost:8080 in setURL's servername
and the Cookie's domain and all the different combinations.  

When I don't setURL and I look at the URL that the servelet receives using
getRequestURL() it says "http://localhost:8080/xmlserver/ServletRedirector".
So I tried putting that in my setURL and it still doesn't work.  But I'm
guessing that that's a symptom of whatever the problem is, i.e.
ServletRedirector somehow has the cookies and when I set my own URL I can't
get to the cookies?

View raw message