Sunday, May 6, 2012

How to change HTTP Session Timeout for WebCenter Spaces?


 If you see WebCenter Spaces application (webcenter.ear) session-timout from the Weblogic Console, this session Timeout (3600 Seconds) is misleading and not applicable in case of WebCenter Spaces application. If you update this value from the console, it will not impact session-timeout of the WebCenter Spaces application.
 
Then question is how can I change session-timeout for WebCenter Spaces application? By default session-timeout set in web.xml is 45 minutes. There are following two ways to change the session-timeout:-
  
        1. Deployment Descriptors(web.xml and weblogic.xml)
       2. Customizing the Session Timeout sample project of SampleWebCenterSpacesExtensions (Supported solution till PS4)

Here, we will not discuss solution-2 as this project is excluded from PS5 documentation and sample project. If you are running WC Spaces PS3 or PS4, you can implement it as well.

You can update the session timeout in web.xml as well as weblogic.xml but if web.xml takes precedence over the weblogic.xml. Here, we will configure the session timeout in web.xml as recommended by Oracle in following documentation as well:-


Following are the steps to modify the web.xml for session timeout value:-

1.       Go to <WEBCENTER-HOME> /archives/applications directory and you will find webcenter.ear file there. In my case the complete path is C:\Oracle\Middleware\Oracle_WC1\archives\applications.
2.       Backed up webcenter.ear in <WEBCENTER-HOME> /archives/applications as webcenter.ear.bak
3.       Open the webcenter.ear file using winrar or 7zip or any other tool

4.       Now, go to spaces.war >> WEB-INF folder and open the web.xml file in editor
 
     

5.       Add following entry in it:-
<session-config>
                                         <session-timeout>15</session-timeout>
                         </session-config>
Pls note that session-timeout value in web.xml is in minutes whereas in weblogic.xml it is in seconds.


6.       Once done, save it and close it.
7.       Make sure that webcenter.ear contain an updated web.xml.
8.       Restart WC_Spaces servers. At startup, this automatically deploys the newer application with the modified web.xml.
Note: Once application is deployed, revised spaces.war is available at <DOMAIN-HOME> /servers\WC_Spaces\tmp\_WL_user\webcenter_11.1.1.4.0\<Randon-Folder-Name>. You can verify the web.xml changes as well.


Note:- From PS5 onward, there is one more way to change the session timeout, see the following documentation:-
http://docs.oracle.com/cd/E23943_01/webcenter.1111/e12405/wcadm_gen_prop.htm#BCEHFHCH


References:-