webtier@glassfish.java.net

Re: [webtier] Re: default cookie domain of jsession id cookie

From: Jan Luehe <Jan.Luehe_at_Sun.COM>
Date: Wed, 29 Apr 2009 17:45:03 -0700

Yes, cookie-properties is defined only for sun-web.xml, not web.xml.

As for configuring the cookie domain in a portable fashion,
Servlet 3.0 is your friend, see javax.security.SessionCookieConfig. :)

With Servlet 3.0, the following code (e.g., in a ServletContextListener)
is possible:

  public void contextInitialized(ServletContextEvent sce) {
      sce.getServletContext().getSessionCookieConfig().setDomain(
          ".mysite.com");
  }

You can try this on the latest GlassFish v3.

Let us know if you have any questions.

Thanks!

Jan

> [Message sent by forum member 'onlyplastik' (onlyplastik)]
>
> http://forums.java.net/jive/thread.jspa?messageID=344378
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: webtier-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: webtier-help_at_glassfish.dev.java.net
>
>