{"id":161,"date":"2017-03-06T07:58:38","date_gmt":"2017-03-06T05:58:38","guid":{"rendered":"http:\/\/geekinto.com\/?p=161"},"modified":"2017-03-07T06:23:13","modified_gmt":"2017-03-07T04:23:13","slug":"oracle-apex-handling-expire-session-by-message-to-end-user-by-js","status":"publish","type":"post","link":"https:\/\/howoracleapex.com\/?p=161","title":{"rendered":"Oracle APEX | Handling Expire Session by Message to End User by JS"},"content":{"rendered":"<p>Welcome ..<\/p>\n<p style=\"padding-left: 60px;\">Next JS Code: \u00a0just handling\u00a0<em>hang<\/em> or <em>suspend<\/em> application when session expired by alert message to end user &amp; redirect him to login page.<\/p>\n<p style=\"padding-left: 60px;\">#APEX Ver: &gt;= 5.0<\/p>\n<p>Please put this code on <strong>Application level<br \/>\n<\/strong><\/p>\n<pre class=\"lang:js decode:true  \">window.onerror = function(msg) {\r\n\r\n\/\/ Type you message here ..\r\n    var clientMsg = 'Sorry, But Your Session Has Expired, I will redirect you to login page !';\r\n\/\/ Type your app Id\r\n    var appID = '145';\r\n    \r\n\r\n    var chk = 'SecurityError:';\r\n    if (msg.includes(chk)){\r\n\r\n        \/\/Apex ver: &gt;= 5.0\r\n        apex.message.alert(clientMsg,function(){\r\n                window.location = 'f?p=' + appID + ':LOGIN_DESKTOP';\r\n            }\r\n        );\r\n\r\n        \/\/Apex ver: &lt; 5.0\r\n        \/\/alert(clientMsg);\r\n        \/\/window.location = 'f?p=' + appID + ':LOGIN_DESKTOP';\r\n\r\n    }\r\n    return true;\r\n}<\/pre>\n<p><strong>\u00a0<\/strong><\/p>\n<p>1- Now clear your session manually by this toolkit:<br \/>\n<a href=\"https:\/\/chrome.google.com\/webstore\/detail\/clear-session\/maejjihldgmkjlfmgpgoebepjchengka\">https:\/\/chrome.google.com\/webstore\/detail\/clear-session\/maejjihldgmkjlfmgpgoebepjchengka<\/a><\/p>\n<p><a href=\"https:\/\/chrome.google.com\/webstore\/detail\/clear-session\/maejjihldgmkjlfmgpgoebepjchengka\"><br \/>\n<\/a>2- Try to go to another page .. You will show alert message.<\/p>\n<p>&nbsp;<\/p>\n<p>Regards,<\/p>\n<p>Amr<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Welcome .. Next JS Code: \u00a0just handling\u00a0hang or suspend application when session expired by alert message to end user &amp; redirect him to login page. #APEX Ver: &gt;= 5.0 Please put this code on&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,13,12,2],"tags":[],"class_list":["post-161","post","type-post","status-publish","format-standard","hentry","category-apex","category-jquary","category-jscript","category-oracle"],"_links":{"self":[{"href":"https:\/\/howoracleapex.com\/index.php?rest_route=\/wp\/v2\/posts\/161","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/howoracleapex.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/howoracleapex.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/howoracleapex.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/howoracleapex.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=161"}],"version-history":[{"count":8,"href":"https:\/\/howoracleapex.com\/index.php?rest_route=\/wp\/v2\/posts\/161\/revisions"}],"predecessor-version":[{"id":169,"href":"https:\/\/howoracleapex.com\/index.php?rest_route=\/wp\/v2\/posts\/161\/revisions\/169"}],"wp:attachment":[{"href":"https:\/\/howoracleapex.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=161"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/howoracleapex.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=161"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/howoracleapex.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=161"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}