ColdFusion MX 6.1: Session is invalid error when using J2EE session management
Issue
When using session variables within a Macromedia ColdFusion MX 6.1 application, the following error may occur if J2EE session management is enabled in the ColdFusion Administrator:
Error Occurred While Processing Request Session is invalid
The error is generated when the underlying J2EE session times out before the ColdFusion session times out.
By default, the J2EE session timeout is hard coded to 30 minutes in the cf_root\wwwroot\WEB-INF\web.xml configuration file. The ColdFusion session timeout is set on the Memory Variables page in the ColdFusion MX administrator or in acfapplication tag. If the timeout value set for the ColdFusion session is greater than 30 minutes, it is possible for the J2EE session to time out before the ColdFusion session times out, resulting in the "Session is invalid" error. This has been identified as Macromedia Issue 51982.
Solution
Using the steps below, ensure the J2EE session timeout is greater than or equal to the longest ColdFusion session timeout being specified in the ColdFusion Administrator or within acfapplication tag.
- Stop the ColdFusion MX Application service.
- Open the web.xml file for editing.
Server Configuration:cf_root\wwwroot\WEB-INF\web.xml - Set the J2EE session timeout to be greater than or equal to the longest ColdFusion session timeout set in your ColdFusion Administrator and/or
cfapplicationtag.
<session-config><session-timeout>66</session-timeout></session-config>
In the example above, the J2EE session timeout is set to 66 minutes. - Save the changes to the web.xml file.
- Start the ColdFusion MX Application service.
Note: Do not set the J2EE session timeout to an arbitrarily high value, like several days or weeks, as these session structures are retained in memory. Doing so may lead to excessive memory utilization which may negatively impact performance.
Additional Information
Related TechNotes:
- ColdFusion MX 6.1 confirmed issues
- How to enable J2EE session management in ColdFusion MX
- How to prevent session swapping
This content requires Flash
To view this content, JavaScript must be enabled, and you need the latest version of the Adobe Flash Player.
Download the free Flash Player now!
