Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: added note on how to disable url rewriting, based on http://jira.codehaus.org/browse/JETTY-467

...

Context Parameter Name

Default Value

Description

org.mortbay.jetty.servlet.SessionCookie

JSESSIONID

Session cookie name.efaults to JSESSIONID, but can be set for a particular webapp with this context param.

org.mortbay.jetty.servlet.SessionURL

jsessionid

Session URL parameter name. Defaults to jsessionid, but can be set for a particular webapp with this context param. Set to "none" to disable URL rewriting.

org.mortbay.jetty.servlet.SessionDomain

-

Session Domain. If this property is set as a ServletContext param, then it is used as the domain for session cookies.If it is not set, then no domain is specified for the session cookie.

org.mortbay.jetty.servlet.SessionPath

-

Session Path. If this property is set as a ServletContext param, then it is used as the path for the session cookie. If it is not set, then the context path is used as the path for the cookie.

org.mortbay.jetty.servlet.MaxAge

-1

Session Max Age. If this property is set as a ServletContext param, then it is used as the max age for the session cookie. If it is not set, then a max age of -1 is used.

...

Code Block
xml
xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app
    xmlns="http://java.sun.com/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
    version="2.5">

...
<context-param>
    <param-name>org.mortbay.jetty.servlet.SessionCookie</param-name>
    <param-value>XSESSIONID</param-value>
  </context-param>

<context-param>
    <param-name>org.mortbay.jetty.servlet.SessionURL</param-name>
    <param-value>xsessionid</param-value>
</context-param>

...
</web-app>

or, they can be set in a Jetty context xml file that configures a web application:

Code Block
xml
xml

<Configure class="org.mortbay.jetty.webapp.WebAppContext">
  <Set name="contextPath">/test</Set>
  <Set name="war"><SystemProperty name="jetty.home" default="."/>/webapps/test</Set>

   ...

  <Set name="initParams">
    <Map>
      <Entry>
       <Item>org.mortbay.jetty.servlet.SessionCookie</Item>
       <Item>XSESSIONID</Item>
      </Entry>
      <Entry>
       <Item>org.mortbay.jetty.servlet.SessionURL</Item>
       <Item>xsessionid</Item>
      </Entry>
    </Map>
  </Set>
</Configure>
Contact the core Jetty developers at www.webtide.com
private support for your internal/customer projects ... custom extensions and distributions ... versioned snapshots for indefinite support ... scalability guidance for your apps and Ajax/Comet projects ... development services from 1 day to full product delivery