sun-web.xml Visual Editor: Session

See Also

The sun-web.xml visual editor lets you edit the platform-specific web deployment descriptor for Sun Java System Application Server. You open the visual editor by expanding your project's Configuration Files node in the Projects window and double-clicking the sun-web.xml file. A web application only contains a sun-web.xml deployment descriptor if its target server is the Sun Java System Application Server.

The Session tab of the editor helps you configure the persistence type and the session properties for a web application session. The session properties are grouped under the following categories:

Persistence Type

Select the persistence type from the pull-down list. This table describes the persistence types supported by Application Server.

Type Description
Memory

Use this persistence type to store session data in the system's memory.

File

Use this persistence type to store session data in a file. If the instance becomes unavailable and restarts, it can recover the session information that was last written to the files.

Manager Properties

The Manager Properties help you configure how sessions are created and destroyed, where session state is stored, and the maximum number of sessions.

The following table lists the session manager parameters.

Name Description
reapIntervalSeconds The number of seconds after which Application Server will check for expired sessions. This is also the interval at which sessions are passivated if maxSessions is exceeded.
maxSessions The maximum number of active sessions. If there is no limit on the number of active sessions, type -1. The session manager passivates sessions to the persistent store when this maximum number is reached. This property is applicable only if the Persistence Type is File.
sessionFilename The absolute or relative pathname of the file in which the session state is preserved between application restarts, if preserving the state is possible. A relative pathname is relative to the temporary directory for this web module.

Store Properties

The Store Properties control how the sessions are stored in the Application Server.

The following table lists the session store parameters.

Name Value
directory The absolute or relative pathname of the directory into which individual session files are written. A relative path is relative to the temporary work directory for this web module. This property is applicable only if the Persistence Type is File.

Session Properties

The Session Properties help you configure how the sessions behave in the Application Server.

The following table lists the session properties.

Name Value
timeoutSeconds The default maximum inactive interval, in seconds, for all sessions created in this web module. If set to 0 or less, sessions, this web module never expires. The value of session-timeout element in the web.xml overrides this value.
enableCookies If this property is set to true, cookies are used for session tracking.
enableURLRewriting If this property is set to true, URL rewriting is enabled. This provides session tracking via URL rewriting when the browser does not accept cookies. You must also use an encodeURL or encodeRedirectURL call in the servlet or JSP.
idLengthBytes The number of bytes in this web module’s session ID.

Cookie Properties

The Cookie Properties specify the cookies generated by the Application Server. The following table lists the session cookie properties.

Name Value
cookiePath The pathname that is set when the cookie is created. The browser sends the cookie if the pathname for the request contains this pathname. If set to / (slash), the browser sends cookies to all URLs served by the Application Server. You can set the path to a narrower mapping to limit the request URLs to which the browser sends cookies.
cookieMaxAgeSeconds The expiration time, in seconds, after which the browser expires the cookie.
cookieDomain The domain for which the cookie is valid.
cookieComment The comment that identifies the session tracking cookie in the cookie file. Applications can provide a more specific comment for the cookie.
See Also
About Deployment Descriptors
Editing a Web Application's Deployment Descriptors
Changing the Target Server
sun-web.xml Visual Editor:
         General
         Session
         Messages
         Locale
         Cache Mappings
         Web Service Descriptor

Legal Notices