如何查找 Oracle APEX 会话是否过期
简短版本:
如果函数wwv_flow_custom_auth_std.is_session_valid(或apex_custom_auth_std.is_session_valid)返回TRUE,是否有可能会话已过期但仍然存在?如果是这样,如何检查会话是否过期?
长版:
我为我们的 Oracle APEX 应用程序创建了一个单点登录系统,大致基于本教程:
http://www.oracle.com/technology/oramag/oracle/09-may/o39security.html
唯一的区别是我的主 SSO 登录是在 Perl 中,而不是另一个 APEX 应用程序。它设置一个 SSO cookie,应用程序可以通过数据库过程检查它是否有效。
我注意到,当我早上到达时,整个系统不起作用。我从 APEX 应用程序重新加载页面,然后它会将我发送到 SSO 页面,因为会话已过期,我登录并重定向回原来的 APEX 应用程序页面。除了早上第一件事之外,这通常有效。 APEX 会话似乎已过期。在这种情况下,它似乎找到了会话,但随后拒绝使用它,并将我发送回登录页面。
我已尽力追踪问题。 “wwv_flow_custom_auth_std.is_session_valid”函数返回 true,因此我假设会话有效。但在我删除 APEX 会话 cookie 之前,什么都不起作用。然后我就可以轻松地重新登录了。
有人知道是否有另一个电话可以告诉我会话是否已过期?
谢谢
Short version:
If the function wwv_flow_custom_auth_std.is_session_valid (or apex_custom_auth_std.is_session_valid) returns TRUE, is it possible that the session is expired but still alive? If so, how can you check if a session is expired?
Long version:
I have created a single-sign-on system for our Oracle APEX applications, roughly based on this tutorial:
http://www.oracle.com/technology/oramag/oracle/09-may/o39security.html
The only difference is that my master SSO login is in Perl, rather than another APEX app. It sets an SSO cookie, and the app can check if it's valid with a database procedure.
I have noticed that when I arrive in the morning, the whole system doesn't work. I reload a page from the APEX app, it then sends me to the SSO page because the session was expired, I logon, and get redirected back to my original APEX app page. This usually works except first thing in the morning. It seems the APEX session is expired. In that case it seems to find the session, but then refuse to use it, and sends me back to the login page.
I've tried my best to trace the problem. The "wwv_flow_custom_auth_std.is_session_valid" function returns true, so I'm assuming the session is valid. But nothing works until I remove the APEX session cookie. Then I can log back in easily.
Anybody knows if there is another call that would tell me if the session is expired or not?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以在应用程序安全属性页面下设置最大会话长度(以秒为单位)。
Apex 声明如下:
“会话持续时间可能会被每 8 小时运行一次的作业操作所取代,该操作会删除超过 12 小时的会话。”
您可以使用视图
apex_040100.APEX_WORKSPACE_SESSIONS
根据会话的存在或创建时间来确定会话是否有效。例如:session_created - systdate > 12 小时。您还应该使用“在会话超时时直接访问此 URL”属性。
You can set the Maximum Session length in seconds under the application security attributes page.
Apex states the following:
"The session duration may be superseded by the operation of the job that runs every eight hours which deletes sessions older than 12 hours."
You could use the view
apex_040100.APEX_WORKSPACE_SESSIONS
to determine if a session is valid based on its existance or creation time. eg:session_created - systdate > 12Hours
.You should also use the "On session timeout direct to this URL" attribute.
此解决方案需要特权访问,但您可以在 apex 架构中查询 wwv_flow_sessions$ 视图,以查找与您的用户名匹配的任何会话。如果不存在,则您的会话已超时。此视图还为您提供了一个“idle_timeout_on”字段,该字段将告诉您的会话计划何时超时。
This solution would require privileged access but you can query the wwv_flow_sessions$ view in your apex schema for any session that matches your username. If none exists, your session has timed out. This view also gives you a field 'idle_timeout_on' that will tell when your session is scheduled to time out.