cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Newland" <>
Subject RE: [C2] [Bug?] Cookies missing from environment
Date Fri, 07 Dec 2001 11:50:18 GMT
Hi Stuart,

I had some problems using the cookie taglib myself so I resorted to Java
code in my XSP.

Here's a snippet of the code I use (works for me on Cocoon2b2)

(very hacky - breaks the separation of concerns principle - I'll take
another look at the taglib when I have time ;)





Cookie[] user_cookies = <xsp-cookie:getCookies/>;

Cookie user_cookie = null;

if (user_cookies != null)

  for (int i = 0; i < user_cookies.length; i++)

    if (user_cookies[i].getName().equals("test_cookie"))
      user_cookie = user_cookies[i]; <!-- cookie was found -->




Hope this helps,

Best Regards,


PS. Shall we take this to the cocoon-users mailing list as there may be
other users with solutions to this problem ?

-----Original Message-----
From: Stuart Roebuck []
Sent: 07 December 2001 11:22
Subject: Re: [C2] [Bug?] Cookies missing from environment


Thanks for the rapid response...

Looking at the Cocoon log the "HEADER PARAMETERS" of the request display
the cookie:

> PARAM: 'cookie' VALUES: '[JSESSIONID=D29143D183239003153020F4A5F020A1;
> testcookie=31]'
>                                                                        ^^
> ^^^^^^^^^^^

so it's getting there, but seems to be getting no further. I'm surprised
if I'm the first person to find this, which is why I reckon I must be
doing something brain-dead.


On Friday, December 7, 2001, at 11:05 am, Chris Newland wrote:

> Hi Stuart,
> Are you sure that the client browser is adding the cookie to the http
> request it is making to Cocoon? A cookie contains a path parameter that
> tells the browser that the cookie should only be submitted when the
> browser
> is requesting URLs that match a certain path on the server.
> If you want the cookie to be submitted to every URL on a given server then
> set the cookie path parameter to "/".
> You can check if the browser is submitting the cookie by using a HTTP
> viewer
> that acts as a proxy to your browser. For Windows I would recommend
> HTTPInspector, but I'm sure there are equivalent tools for *NIX. The
> cookies
> will appear in the HTTP header.
> Best Regards,
> Chris
> -----Original Message-----
> From: Stuart Roebuck []
> Sent: 07 December 2001 10:47
> To:
> Subject: [C2] [Bug?] Cookies missing from environment
> I'm currently working on an action which needs to set and check cookies.
> Setting is fine, but checking/reading is not working.
> It gets the request from the environment and uses either getCookies or
> getCookieMap to get the list of cookies.  But neither work, despite the
> fact that session handling is working fine - i.e. the session cookie is
> being handled correctly by the system (I'm not using URL rewriting) - so
> the browser is storing and returning the JSESSIONID cookie.
> I did some remote debugging, put a breakpoint on every call to the Cocoon
> HttpRequest constructor and found that the HttpServletRequest object
> passed to it never contains any cookies.
> Any ideas or pointers - am I doing something really brain-dead?
> Thanks,
> Stuart.

            Public Key - 1024D/88DD65AF 2001-11-23 Stuart Roebuck (Adolos)
      Key fingerprint = 89D9 E405 F8B1 9B22 0FA2  F2C1 9E57 5AB1 88DD 65AF
Stuart Roebuck                        
Lead Developer                               Java, XML, MacOS X, XP, etc.
ADOLOS                                           <>

To unsubscribe, e-mail:
For additional commands, email:

To unsubscribe, e-mail:
For additional commands, email:

View raw message