We have a "Monitor" screen that makes use of an Interactive Report and a periodic (Every 5 mins) Partial Page Refresh. The issue is that, after some period of inactivity, the screen locks during refresh and the error:
You are not authorized to access the requested resource. Check the supplied credentials (e.g., username and password).
Appears in the Global Notification Error region.
I'd originally posted about this issue some time ago at Re: Timeout Issue with APEX However, I really never got an answer. This application is now getting ready for a broad production rollout and the issue remains.
The plugin does not work for us as it simply redirects the user to the login page and makes them log in again. We simply do not want the PPR to time out. We can control session idle timeout in general with the APEX Instance settings but, these do not appear to have any bearing on the timeout period for PPRs. BTW, does anyone know to what this timeout threshold is currently set?
Has anyone else run into this and, if so, any suggested work arounds? Is there some way to "fake" the browser into believing User Activity has happened, e.g. using APEX to trigger the clicked event of a button or something?
have a look at Patrick's hints on the session timeouts:
I think he also describes where to set the values and refers to an OBE on this topic.
No....doesn't help. Thanks, though.
That is the setting to which I refer in my original post. It does work for keeping you logged in to the application. However, specifically, there is a problem if you have a Partial Page Refresh region. That's where my issue lies.
Let me see I if I got this right:
you say that if set an inactivity timeout threshold to 10 minutes, then if during these 10 minutes you just click on the pagination buttons in a PPR region without doing any other APEX activity, then the timeout occurs?
Supposing that for some reason you cannot remove the inactivity timeout, then I'd go for a dynamic action attached to the pagination buttons (they come with their own CSS class if I remember well), and in this dynamic action you execute something that resets the timeout, most likely you need to do something that changes the state of an apex session variable.
Let's say, within the instance Security Settings for the workspace, you set Maximum Session Length in Seconds and Maximum Session Idle Time in Seconds both to 0. The documentation says that, for the prior "Enter 0 to have the session exist indefinitely" and for the latter "Set to 0 to prevent session idle time checks from being performed"
These do appear to work so long as the page does not have a PPR region on it (that is being routinely and automatically refreshed).
However, when you do have such a region, the PPR region itself will "hang" with exactly the behavior decribed here (http://www.talkapex.com/2009/09/enhanced-apex-session-timeouts.html).
Specifcally, this post amounts to:
1. What is the setting to reset?
2. What does it need to be reset to?
3. How do I reset it?
Ok, now, reading your past thread I understand that the problem you describe is:
1. you start the IR report
2. the report starts refreshing automatically
3. after some hours the session expires and the IR shows the "refreshing" icon indefinitely
The documentation says that setting the max session length to null, it will last indefinitely, however that's not true because a session can't live for more than 12 hours. There is a background job running every 8 hours that wipes out sessions older than 12 hours.
Now, what I am not clear with, is the kind of solution you are pursuing. Given the fact that there is an enforced limit of 12 hours, you can't expect to extend the session lifetime beyond that limit (unless we find a way to hack the session creation time I guess or copy over all session values to a new session before it expires). Some of the prospected solutions assume that you are using an application with a short session lifetime (10 minutes as in the example of Martin), that can be extended when it's over, however this doesn't seem to be possible in the case of an application whose session has already reached the maximum hard coded limit of 12 hours.
The only viable solution I see is to check if the session has expired from within a dynamic action triggered by a before refresh framework event defined on the IR region and redirect the browser to the login page.
I like the idea of using the before refresh event.
Another thing to consider, depending on the use case and the extent to which session state is being used, one could write values to a table or cookie and then use those values to "recreate" the previous session.
This doesn't seem like the kind of application that has a real end user so perhaps even the authentication could be automated.
exactly, it's something that needs some investigation, whether it's better to stage the values in a cookie or somewhere else I don't know for sure, there are drawbacks in either cases I guess, but given the fact the values are stored in the db, I'd go for the table, there's gonna be less traffic over the network.
Or may be there is a way to transform the existing session state rows into the fresh ones with a magic touch of SQL update ;-)
Frankly speaking I'd love to see an official Apex API that takes an existing session id and extends it by a user-specified number of minutes.
That's a great idea! You should add it to the Feature Request app:
If you do, share the code with me and I'll vote for it!
Here 480 is 8 min (60 x 8) so that the page re-loads before the session timeout occurs. The code needs to be in the HEAD section of the page.
I suppose you could do a combination of page reload with the meta command and the DA refresh, whatever it's your preference. Or just switch to the meta command.
Sorry, just saw this. For some reason I no longer get emails when my posts receive replies. (it is set up in my prefs to do this).
Are other people still getting updates via Email? That used to work for me and they aren't going to Junk mail or anything.
We don't want to refresh the page, we just want to use the PPR capability to refresh the one region.
To all others who were kind enough to pitch in,
This is not a 12 hour limit. I haven't gotten a specifc time but, it is more like an 1 hour. If they had to restart once per day (or every 12 hours) I think that would be just fine. An interactive Report that is refrreshed via PPR locks up for us after about an hour.