Problems creating or using HTTP sessions

Problems creating or using HTTP sessions

Note: To view and update the Session Manager settings discussed here, use the administrative console. Select the application server that hosts the problem application, then under Additional properties , select Web Container , then Session manager. What kind of problem are you having?

If your problem is not described here, or none of these steps fixes the problem:

HTTP Sessions are not getting created, or are lost between requestsBy default, the Session Manager uses cookies to store the session ID on the client between requests. Unless you intend to avoid cookie-based session tracking, ensure that cookies are flowing between WebSphere Application Server and the browser:

HTTP Sessions are not persistent

If your HTTP sessions are not persistent, that is session data is lost when the
application server restarts or is not shared across the cluster:

Session is shared across multiple browsers on same client machine

This behavior is browser-dependent. It varies between browser vendors, and also may change according to whether a browser is launched as a new process or as a subprocess of an existing browser session (for example by hitting Ctl-N on Windows).

The Cookie maximum age property of the Session Manager also affects this behavior, if cookies are used as the session-tracking mechanism. If the maximum age is set to some positive value, all browser instances share the cookies, which are persisted to file on the client for the specifed maximum age time.

Session is not getting invalidated immediately after specified Session timeout interval

The SessionManager invalidation process thread runs every x seconds to invalidate any invalid sessions, where x is determined based on the Session timeout interval specified in the Session manager properties. For the default value of 30 minutes , x is around 300 seconds. In this case, it could take up to 5 minutes (300 seconds) beyond the timeout threshold of 30 minutes for a particular session to become invalidated.

Unwanted sessions are being created by jsps

As required by the JavaServer Page specification, jsps by default perform a request.getSession(true), so that a session is created if none exists for the client. To prevent jsps from creating a new session, set the session scope to false in the jsp file using the page directive as follows:

<% @page session="false" %>

Session data intended for one client is seen by another client

In rare situations, usually due to application errors, session data intended for one client might be seen by another client. This situation is referred to as session data crossover. When the DebugSessionCrossover custom property is set to true, code is enabled to detect and log instances of session data crossover. Checks are performed to verify that only the session associated with the request is accessed or referenced. Messages are logged if any discrepancies are detected. These messages provide a starting point for debugging this problem. This additional checking is only performed when running on the WebSphere-managed dispatch thread, not on any user-created threads.

For additional information on how to set this property, see article, Web container custom properties.

A ClassCastException error occurs during failover of a session that contains an EJB reference

If you run WebSphere Application Server for z/OS Version 6.0.1 and configure a session manager to replicate EJB references, a session failover might trigger display of the following exception in the server region job log:

java.lang.ClassCastException: cannot cast class        org.omg.stub.java.rmi._Remote_Stub to interface javax.ejb.EJBObject 
The log also displays a null pointer exception. The problem results from the session outbound request, where WebSphere Application Server for z/OS issued a CORBA::COMM_FAILURE exception with a C9C21355 minor code. This behavior occurs because your application server contains all of the following configurations:

  1. SAF is both the local operating system, as well as the user registry

  2. Attribute propagation is enabled

  3. An unauthenticated user initiated the session outbound request
To correct this problem apply the APAR PK06777 fix to WebSphere Application Server for z/OS V6.0.1. You can retain the previously mentioned server configurations.

For current information available from IBM Support on known problems and their resolution, see the IBM Support page.

For current information available from IBM Support on known problems and their resolution, see Support for WebSphere Application Server for OS/400.

IBM Support has documents that can save you time gathering information needed to resolve this problem. Before opening a PMR, see the IBM Support.


Related tasks

Troubleshooting by task

Troubleshooting by component

Searchable topic ID: rtrb_httpsessprobs