Try to break it down in steps:

var cookies = cocoon.request.getCookies();
if (cookies.size() > 0) {
   var firstcookie = cookies[0];
   print("first cookie value: " + firstcookie.getValue());
}

HTH.

Bye, Helma

> -----Original Message-----
> From: David Merrilees [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, 30 November, 2004 13:02
> To: [EMAIL PROTECTED]
> Subject: RE: retrieving a cookie value in flowscript - Email 
> has different SMTP TO: and MIME TO: fields in the email addresses
> 
> 
> I thought that. Both methods produce the same error, as does 
> getName(). 
> 
> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] 
> Sent: 30 November 2004 11:18
> To: [EMAIL PROTECTED]
> Subject: RE: retrieving a cookie value in flowscript - Email 
> has different SMTP TO: and MIME TO: fields in the email addresses
> 
> the function getValue() should return a String... Anyway... 
> shouldn't you use
>  getCookies()[0].getValue() instead of .value()
> 
> http://cocoon.apache.org/2.1/apidocs/org/apache/cocoon/environ
> ment/Cooki
> e.ht
> ml
> 
> Kind regards,
> Robby Pelssers
> 
> -----Original Message-----
> From: David Merrilees [mailto:[EMAIL PROTECTED]
> Sent: 30 November, 2004 10:43
> To: [EMAIL PROTECTED]
> Subject: retrieving a cookie value in flowscript
> 
> 
> I'm having trouble retrieving a cookie value in flowscript. I 
> have a cookie set with the value 'true'. When I retrieve the 
> value using flowscript I receive the error:
> 
> true is not a function.
> 
> org.apache.avalon.framework.CascadingRuntimeException: true 
> is not a function.
> 
> 
> My flowscript:
> 
> function contact() {
>       var test = cocoon.request.getCookies()[0].value()
>               cocoon.sendPage( "test.jx", { "test" : test } ); }
> 
> Any ideas?
> 
> David Merrilees
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to