Skip to main content

[webtier] Re: Using glassfish without cookies

1 reply [Last post]
Anonymous

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Jan Luehe

On 12/10/08 03:50, glassfish@javadesktop.org wrote:
> Hi.
> Can you help me DISABLE cookies within glassfish, and using for sessions only URL rewriting, please?
>

There are 2 ways of doing this:

1. Bundle a sun-web.xml with your webapp, and set "enableCookies" to
"false":






2. Leverage the new Servlet 3.0 facilities for disabling cookies
programmatically,
by declaring a ServletContextListener and implementing its
contextInitialized method
as follows:

public void contextInitialized(ServletContextEvent sce) {
sce.getServletContext().setSessionTrackingModes(
EnumSet.of(SessionTrackingMode.URL));
}

Hope this helps.

Jan

> Thanks !
> [Message sent by forum member 'sandstorm_sh' (sandstorm_sh)]
>
> http://forums.java.net/jive/thread.jspa?messageID=320971
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: users-help@glassfish.dev.java.net
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: webtier-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: webtier-help@glassfish.dev.java.net