【问题标题】:Session Timeout on Application level in Oracle ApexOracle Apex 中应用程序级别的会话超时
【发布时间】:2021-01-03 03:11:40
【问题描述】:

在我的应用程序 ID 中,我更改了安全属性 -> 最大会话空闲时间(以秒为单位)为 900 秒,但问题是如果我在同一页码上,它会给我会话超时消息。

我希望用户在页面或其他选项卡上移动时的会话超时,它不应受到限制,因为我所有的应用程序工作大部分都在一个页面中。

【问题讨论】:

  • 是否意味着您的应用程序像单页应用程序一样工作?这是否意味着他们向服务器发送 ajax 请求?或者这是否意味着用户正在执行需要很长时间的任务(填写长表格、玩游戏等)?
  • 是的,填写长时间的作业是一个很大的过程,但不是通过提交页面而是通过动态操作完成的。

标签: oracle-apex oracle-apex-5 oracle-apex-5.1


【解决方案1】:

会话超时由 Web 应用服务器管理,它需要一个请求或表单提交来告诉他,嘿,我还活着,伙计,请不要终止会话,因此你需要创建一个 ajax 请求告诉网络服务器你还在那里。

您可以使用此脚本来检测用户不活动

var IDLE_TIMEOUT = 60; //seconds
var _idleSecondsCounter = 0;
document.onclick = function() {
    _idleSecondsCounter = 0;
};
document.onmousemove = function() {
    _idleSecondsCounter = 0;
};
document.onkeypress = function() {
    _idleSecondsCounter = 0;
};
window.setInterval(CheckIdleTime, 1000);

function CheckIdleTime() {
    _idleSecondsCounter++;
    var oPanel = document.getElementById("SecondsUntilExpire");
    if (oPanel)
        oPanel.innerHTML = (IDLE_TIMEOUT - _idleSecondsCounter) + "";
    if (_idleSecondsCounter >= IDLE_TIMEOUT) {
        alert("Time expired!");
        document.location.href = "logout.html";
    }
}

查看此帖子Detecting user inactivity over a browser - purely through javascript

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-05-19
    • 1970-01-01
    • 1970-01-01
    • 2019-06-23
    • 2015-01-02
    • 1970-01-01
    • 2011-06-05
    相关资源
    最近更新 更多