Monday, December 6, 2010

How to set Session time out in ADF application

Hi,

Simple tip today but probably most of my friend coming from FORMS background are not familiar with this. Where and how to set the Session time out setting in Oracle ADF application? Answer is with every application there is a file called web.xml file in your ViewController Project WEB-INF folder. The file which contains configuration settings for your web application on run-time. JDeveloper provides a declarative way to modify this settings by default the session timeout is 35 minutes.

Here what documentation says
Session Timeout
(Optional) Enter an integer value of minutes of inactivity are required before you want to force your web application's sessions to expire. Corresponds to the tag of the subelement. Note, this value can be overridden for individual sessions by means of the setMaxInactiveInterval() method of the javax.servlet.http.HttpSession interface.

Here is the setting in Jdeveloper



after deployment you can see the timeout value in the deployment properties of your application as well here the screen shot of weblogic console





On runtime if session expires you will get the similar message



Happy Jdeveloping,
Zeeshan Baig

11 comments:

  1. Which one takes priority
    The setting in the web.xml or what is defined in the weblogic

    ReplyDelete
    Replies
    1. This comment has been removed by the author.

      Delete
    2. So from what you are saying. If I set it globally in weblogic to a different value in weblogic, it will override the value in web.xml?

      Delete
    3. Hi,

      OK i got it what you mean.... Ignore my last reply...

      By setting it on web.xml and weblogic have same impact. both values are coming from web.xml but if you redeploy your application then you might lose your weblogic configuration.

      As best practice set it to web.xml and in weblogic it is also displaying application specific values not global (there is no global value for ADF application)

      ZB

      Delete
    4. What could be the reasons where session timeout does not work? I tried first by updating web.xml (1min) and then weblogic.xml (60 secs). Both of them does not override the default timeout - 35 mins.

      Delete
    5. Hi,

      Are you using ADF application or any other product like webcenter etc etc ?

      Zeeshan

      Delete
    6. Interestingly, setting the timeout to 5 minutes in web.xml works. I don't know why 1 minute is not working.

      Delete
    7. Some times it is cache of server.

      Delete
  2. What if the application is webcenter portal

    ReplyDelete
    Replies
    1. Hi,

      Check webcenter portal documentation. I have done in webcenter spaces application (very old one) you have to find the web.xml that it uses. For Portal it should be straight forward.

      Regards,
      Zeeshan

      Delete