This discussion is archived
7 Replies Latest reply: Aug 16, 2012 8:19 AM by Joe Upshaw RSS

Timeout Issue with APEX

Joe Upshaw Journeyer
Currently Being Moderated
We are encountering an issue with APEX timing out and, thereafter, not redirecting the user to the login page. Rather, in the global notification area, APEX is placing this message:
>
You are not authorized to access the requested resource. Check the supplied credentials (e.g., username and password)
>

We have noticed this in a couple of cases. One, on pages with a partial page refresh, i.e. an IRR region refreshed on an interval. For example:
<script type="text/javascript">
<!--
  setInterval("jQuery('#clearer_watch_report').trigger('apexrefresh');", 60000);
//-->
</script>
Two, on pages with Cascading LOVs. User leaves screen up, goes to lunch, comes back and picks a parent LOV, the above error is seen.

In this case, the user must click the Logout link (but, generally, they just freak out and don't think of doing this).

Is there someway to trap this condition and redirect to the login page (or otherwsie to elegantly notify the user of the timeout)?

-Joe
  • 1. Re: Timeout Issue with APEX
    Joe Upshaw Journeyer
    Currently Being Moderated
    I found something that looks promising under the Shared Components, Authentication Schemes, Session Not Valid section.

    There, I find a setting for Go To. This is currently set to the first option, "Login Page"

    However, the help text says that this value comes from the Application Properties.

    >
    Specify where Application Express redirects to if the session is not valid. This happens if the Sentry Function or the Verify Function return false, on normal page requests (not on AJAX requests).

    Note: If using the 'Custom' Authentication Scheme Type, the 'Sentry Function' is a property available in the Authentication Scheme. For plug-in Authentication Scheme Types this is defined by the plug-in developer in the Session Sentry Function Name callback.

    Login Page. The Login URL defined in the application properties.
    Built-In Login Page. The Application Express-provided wwv_flow_custom_auth_std.login_page
    URL. An additional item is displayed where you can enter any URL, e.g. f?p=&APP_ID.:101:&SESSION.
    >

    The "Login URL" was blank so I set it to: f?p=&APP_ID.:1:&SESSION.

    We'll see if this works.

    -Joe
  • 2. Re: Timeout Issue with APEX
    dmcghan Oracle ACE
    Currently Being Moderated
    Hi Joe,

    Have a look at our Session Timeout plug-in:
    http://skillbuilders.com/plugins

    Regards,
    Dan

    blog: http://DanielMcghan.us/
    work: http://SkillBuilders.com/APEX/
    twitter: https://twitter.com/dmcghan
  • 3. Re: Timeout Issue with APEX
    Joe Upshaw Journeyer
    Currently Being Moderated
    Thanks, Dan. Like all of your stuff, it looks awesome.

    However, I am really more interested here in whether there is an APEX bug related to partial page refreshes. If you leave a page up and then go home for the night, when you click something the next morning, you generally get redirected to the login page. However, in the case of pages with PPR, instead, you get this weirdly placed message. I am wondering if APEX is mishandling this, particular, situation.

    It's not so much that I want to implement a special timeout handler as it is that I want APEX to behave properly (or to get educated on what I did or failed to do). It might turn out that a special handler is the only work around and, then, I would, for sure, be headed to SkillBuilders ;-)

    -Joe
  • 4. Re: Timeout Issue with APEX
    Joe Upshaw Journeyer
    Currently Being Moderated
    All,

    This did not fix the problem. I think we are looking at an APEX bug here.

    >
    Authorization Required
    You are not authorized to access the requested resource. Check the supplied credentials (e.g., username and password).
    >

    PPRs should redirect the user to the login screen after timeout but, instead, the above message is being printed into the #GLOBAL_NOTIFICATION# area.

    Is there anything I could do, for example in an After Refresh DA to detect and handle (redirect to login) this condition?

    -Joe
  • 5. Re: Timeout Issue with APEX
    dmcghan Oracle ACE
    Currently Being Moderated
    Joe,

    APEX has never handled AJAX well once a session has timed out - it's unfortunate and is the reason for which we created the plug-in. I'm surprised you get the message you do... I had issues with Interactive Reports which just display a loading icon that never finishes.

    Perhaps the behavior will change in the future. Until that time this plug-in should do the trick for you.

    Regards,
    Dan

    blog: http://DanielMcghan.us/
    work: http://SkillBuilders.com/APEX/
    twitter: https://twitter.com/dmcghan
  • 6. Re: Timeout Issue with APEX
    Joe Upshaw Journeyer
    Currently Being Moderated
    Actually, it does both, displays the icon forever and shows that message.

    We will implement the plugin for now buit, I think that I will file a bug for this on Metalink. Seems like APEX could consume the "Invalid Session" error that it receives, even on a PPR, and simply redirect to the Login URL. (Of course, it always seems easier if you aren't the one who actually has to do the work).

    Thanks Again (marking as answered),

    -Joe
  • 7. Re: Timeout Issue with APEX
    Joe Upshaw Journeyer
    Currently Being Moderated
    Sort of answered...the plugin will defnitely provide a nice, elegant work around. However, there is a problem in APEX here that should be fixed in the core product.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points