Set session tracking mode to cookie in Servlet 2.5

1.9k views Asked by At

How can i set the session tracking mode to only use the cookies, i can set this in Servlet 3.0 by setting the <tracking-mode>COOKIE</tracking-mode> in the web.xml or by using currentSession.getServletContext().setSessionTrackingModes(EnumSet.of(SessionTrackingMode.COOKIE)), but sadly these two methods only work for servlet 3.0 and i need to fix it for Weblogic 11g and tomcat 6 which supports servlet 2.5

1

There are 1 answers

1
Mark Thomas On

For Tomcat 6 you can set disableURLRewriting="true" on the Context which will leave Cookies as the only way to track sessions.