The cookie domain must be a domain, not a host.  For a cookie at
"tapestry.apache.org", the domain is "apache.org" and will be valid for
"tomcat.apache.org" as well.  If you don't have at least one period in the
hostname, the cookie just isn't set.  Personally, I have a small bit of
logic to detect if my app is running on localhost (development) and not set
the cookie domain.  Otherwise, it gets set to my company's domain.

-Steve

-----Original Message-----
From: Audrius Peseckis [mailto:[EMAIL PROTECTED] 
Sent: Friday, June 30, 2006 6:06 AM
To: Tapestry users
Subject: How to set cookie ftom T4 application for different host

Hello,

we have a problem when setting cookie value for a different host. When using
standard T4 CookieSource we can set a cookie for our application on
application's host. But we need to set a cookie for a different host. I
suppose it's done with injection of tapestry.globals.HttpServletResponse.

There's a piece of our code that is not working:

Cookie c1 = new Cookie("cookieName", "cookieValue");
  
c1.setDomain("hostname");
c1.setPath("/session_test");
c1.setMaxAge(999999);
  
this.getB().addCookie(c1); // B is declared as <inject
object="service:tapestry.globals.HttpServletResponse" property="b" />

We are trying to set cookie in pageBeginRender method.

Any help is appreciated.

Audrius


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

Reply via email to