SlideShare a Scribd company logo
Exploring the details of
APEX sessions
APEX World 2018, Mar 22, 2018
21-3-2018
Exploring the details of APEX sessions
2
Menno Hoogendijk
Fulltime APEX developer
Working with Oracle since 2008
Tries to be a fullstack developer
Speaking at:
APEX World 2018
APEX Alpe Adria 2018
APEX Connect 2018
Kscope18
@mennooo
mennooo
About me
www.menn.ooo
21-3-2018
Powerful JavaScript skills for APEX developers
3
Menno Hoogendijk
Fulltime APEX developer
Working with Oracle since 2008
Tries to be a fullstack developer
My third Kscope!
Plugin your APEX widgets
Powerful JavaScript skills for all APEX developers
@mennooo
mennooo
About me
Today’s menu
Introduction
Creating a session
The login process
Session state
Smaller session features
The logout process
HTTP Protocol
21-3-2018
Exploring the details of APEX sessions
5
Web server
Browser
HTTP request messages:
GET www.google.com HTTP/1.1
User-Agent: Mozilla/5.0
Accept-Language: en-us
Accept-Encoding: gzip, deflate
Connection: Keep-Alive
HTTP response messages:
HTTP/1.1 200 OK
Content-Length: 88
Content-Type: text/html
Connection: Closed
<html>
<body>
<h1>Hello, World!</h1>
</body>
</html>
HTTP is stateless
21-3-2018
Exploring the details of APEX sessions
6
Web server
User 2 User 3
User 1 User 4
What is a session?
21-3-2018
Exploring the details of APEX sessions
7
“A session establishes stateful behavior across pages for each
user”
How does APEX create a
session?
The HTTP response status code 302 Found is a
common way of performing URL redirection.
What happened in APEX?
21-3-2018
Exploring the details of APEX sessions
12
1 Check if the session is valid
3 Redirect to the “session not valid URL”
2 Create a new session for user “nobody”
1. Check if the session is valid
21-3-2018
Exploring the details of APEX sessions
13
How depends on your Authentication Scheme
If a sentry function exists, it will use that one.
If a sentry function does not exist, it will use the internal one.
Authentication
Scheme
Cookie
Session ID in
Request
Valid?
This is a custom Authentication Scheme
HTTPS only?
2. Create a new session for user “nobody”
21-3-2018
Exploring the details of APEX sessions
16
Even before login, a new session is created
Tip: use apex_dictionary view
select *
from apex_dictionary
where apex_view_name like '%SESSION%'
and column_id = 0;
Tip: grant role to schema to see all data
grant apex_administrator_role to <SCHEMA>;
3. Redirect to the “session not valid URL”
21-3-2018
Exploring the details of APEX sessions
17
Only when sentry returns false
The login process
Authentication Process
21-3-2018
Exploring the details of APEX sessions
23
apex_authentication
.login
Pre Authentication Authentication Post Authentication
21-3-2018
Plugin your APEX widgets
26
Tip: FSP_AFTER_LOGIN_URL in Post Authentication
Purpose:
Do not go to predefined home page, but redirect to custom
URL
:FSP_AFTER_LOGIN_URL := apex_page.get_url(p_page => 2)
21-3-2018
Plugin your APEX widgets
27
21-3-2018
Plugin your APEX widgets
28
Update session for user “nobody” to “ADMIN”
21-3-2018
Exploring the details of APEX sessions
29
Session State – Page Rendering
There are different kinds of session state
21-3-2018
Exploring the details of APEX sessions
31
1 Persisted Session State
2 In Memory Session State
Difference: is or is not stored in WWV_FLOW_DATA table
In Memory Session State
21-3-2018
Exploring the details of APEX sessions
32
2 Page item default value
1 Automatic Row Fetch
3 Page item source value
Demo
21-3-2018
Exploring the details of APEX sessions
33
Persisted Session State
21-3-2018
Exploring the details of APEX sessions
34
2 PL/SQL Process
1 Computation
Persisted Session State - When does the commit take
place?
21-3-2018
Exploring the details of APEX sessions
35
3 If no item value has changed -> end of page rendering
2 If item value has changed -> end of block
1 If item value has changed using apex_util.set_session_state
-> immediately
Demo
21-3-2018
Exploring the details of APEX sessions
36
Session State – Page Processing
What’s new in 5.1
21-3-2018
Exploring the details of APEX sessions
38
2 Reload on submit
1 Always via JSON (using XMLHttpRequest)
Always submit via JSON
Processed via APEX_APPLICATION.ACCEPT
Original JSON in APEX_JSON variables
XMLHttpRequest page submits and the 32k limitation
21-3-2018
Exploring the details of APEX sessions
40
People often mix up three limitations on 32K.
• 32K was the max size of a report row
• 32K is the max size of an APEX item
• mod_plsql limits the size of a single parameter that can be passed to a
procedure to 32K. (ORDS does not have this limitation)
Doing asynchronous page submits in 5.1 only solves the limitation for
mod_plsql because XMLHttpRequest supports chunked uploads.
Solutions for CLOBs (POST requests)
21-3-2018
Exploring the details of APEX sessions
41
2 apex.ajax.clob
1 Use an editable Interactive Grid
var ajaxClob = new apex.ajax.clob()
ajaxClob._set('very long text..')
select clob001
from apex_collections
where collection_name = 'CLOB_CONTENT’;
Reload on submit
21-3-2018
Exploring the details of APEX sessions
42
2 Only for success
1 Always
When reload on submit is set to always,
APEX will process the page synchronous
When reload on submit is set to only for success,
APEX will process the page asynchronous
The request returns a URL in JSON format
apex.navigation.redirect( responseData.redirectURL );
Tip:
Do not use Reload on Submit set Only for Success
in combination with Enable Duplicate Page
Submissions set to No
This will result in an error when first submit is not
successful
Demo
21-3-2018
Exploring the details of APEX sessions
46
Rejoin Sessions
Rejoin sessions
21-3-2018
Exploring the details of APEX sessions
48
When is it useful?
• User is already working in application
• Opens a link to the same application in another tab
□ Via link in email
□ Via bookmark
□ Other..
21-3-2018
Plugin your APEX widgets
49
21-3-2018
Plugin your APEX widgets
50
Rejoin sessions needs to be enabled in the Instance
Administration
Demo
21-3-2018
Exploring the details of APEX sessions
51
Session cloning
APEX session isolation between multiple browser tabs
21-3-2018
Exploring the details of APEX sessions
53
When is it useful?
• When you depend on page/ application items that are not part of page
submission
• For example: an application item that holds a certain context value
□ Tab 1: Context is customer A
□ Tab 2: Context is customer B
• Security risks are not fully guaranteed yet, therefore option is disabled by
default
Step 1: enable feature
21-3-2018
Exploring the details of APEX sessions
54
begin
apex_instance_admin.set_parameter(
p_parameter => 'CLONE_SESSION_ENABLED',
p_value => 'Y'
);
end;
Step 2: add navigation bar list entry for this URL
21-3-2018
Exploring the details of APEX sessions
55
f?p=&APP_ID.:&APP_PAGE_ID.:&APP_SESSION.:APEX_CLONE_SESSION
javascript:window.open('f?p=&APP_ID.:&APP_PAGE_ID.:&APP_S
ESSION.:APEX_CLONE_SESSION',
'f?p=&APP_ID.:&APP_PAGE_ID.:&APP_SESSION.:APEX_CLONE_
SESSION');
Demo
21-3-2018
Exploring the details of APEX sessions
58
The logout process
Logout URL: &LOGOUT_URL.
apex_authentication.logout?p_app_id=106&amp;p_session_id=6311950320799
Session is purged and no longer in apex_workspace_sessions
view
You can purge all instance sessions
Thank you

More Related Content

Similar to Presentatie - Exploring the details of APEX sessions.pdf

Nagios Conference 2013 - Eric Stanley and Andy Brist - API and Nagios
Nagios Conference 2013 - Eric Stanley and Andy Brist - API and NagiosNagios Conference 2013 - Eric Stanley and Andy Brist - API and Nagios
Nagios Conference 2013 - Eric Stanley and Andy Brist - API and Nagios
Nagios
 
20160307 apex connects_jira
20160307 apex connects_jira20160307 apex connects_jira
20160307 apex connects_jira
MT AG
 
Chanhao Jiang And David Wei Presentation Quickling Pagecache
Chanhao Jiang And David Wei Presentation Quickling PagecacheChanhao Jiang And David Wei Presentation Quickling Pagecache
Chanhao Jiang And David Wei Presentation Quickling Pagecache
Ajax Experience 2009
 
Assignment 2 - Power drill Grapevine "It's like Yik Yak, but for opinions ab...
Assignment 2 - Power drill Grapevine  "It's like Yik Yak, but for opinions ab...Assignment 2 - Power drill Grapevine  "It's like Yik Yak, but for opinions ab...
Assignment 2 - Power drill Grapevine "It's like Yik Yak, but for opinions ab...
MATCHmaster
 
Development withforce
Development withforceDevelopment withforce
Development withforce
adm_exoplatform
 
Software Portfolio - SetFocus
Software Portfolio - SetFocusSoftware Portfolio - SetFocus
Software Portfolio - SetFocus
Alexander Vogel
 
High performance coding practices code project
High performance coding practices code projectHigh performance coding practices code project
High performance coding practices code project
Pruthvi B Patil
 
St Hilaire Ajax Start Odtug Nov 2009
St Hilaire   Ajax Start Odtug Nov 2009St Hilaire   Ajax Start Odtug Nov 2009
St Hilaire Ajax Start Odtug Nov 2009
ruiruitang
 
ASP.NET Lecture 2
ASP.NET Lecture 2ASP.NET Lecture 2
ASP.NET Lecture 2
Julie Iskander
 
Introduction To Mvc
Introduction To MvcIntroduction To Mvc
Introduction To Mvc
Volkan Uzun
 
Affordable Workflow Options for APEX
Affordable Workflow Options for APEXAffordable Workflow Options for APEX
Affordable Workflow Options for APEX
Niels de Bruijn
 
Web Slices
Web SlicesWeb Slices
Web Slices
klcintw
 
An introduction to Microsoft Graph for developers
An introduction to Microsoft Graph for developersAn introduction to Microsoft Graph for developers
An introduction to Microsoft Graph for developers
Microsoft 365 Developer
 
JS digest. January 2018
JS digest. January 2018 JS digest. January 2018
JS digest. January 2018
ElifTech
 
ASP.NET AJAX with Visual Studio 2008
ASP.NET AJAX with Visual Studio 2008ASP.NET AJAX with Visual Studio 2008
ASP.NET AJAX with Visual Studio 2008
Caleb Jenkins
 
senior software developer .net
senior software developer .netsenior software developer .net
senior software developer .net
Rakesh Kumar Kushwaha
 
PnP Webcast - Sharepoint Access App scanner
PnP Webcast - Sharepoint Access App scannerPnP Webcast - Sharepoint Access App scanner
PnP Webcast - Sharepoint Access App scanner
SharePoint Patterns and Practices
 
Rapid Development With CakePHP
Rapid Development With CakePHPRapid Development With CakePHP
Rapid Development With CakePHP
Edureka!
 
Building Restful Web App Rapidly in CakePHP
Building Restful Web App Rapidly in CakePHPBuilding Restful Web App Rapidly in CakePHP
Building Restful Web App Rapidly in CakePHP
Edureka!
 
Backup Exec Partner Toolkit
Backup Exec Partner ToolkitBackup Exec Partner Toolkit
Backup Exec Partner Toolkit
Symantec
 

Similar to Presentatie - Exploring the details of APEX sessions.pdf (20)

Nagios Conference 2013 - Eric Stanley and Andy Brist - API and Nagios
Nagios Conference 2013 - Eric Stanley and Andy Brist - API and NagiosNagios Conference 2013 - Eric Stanley and Andy Brist - API and Nagios
Nagios Conference 2013 - Eric Stanley and Andy Brist - API and Nagios
 
20160307 apex connects_jira
20160307 apex connects_jira20160307 apex connects_jira
20160307 apex connects_jira
 
Chanhao Jiang And David Wei Presentation Quickling Pagecache
Chanhao Jiang And David Wei Presentation Quickling PagecacheChanhao Jiang And David Wei Presentation Quickling Pagecache
Chanhao Jiang And David Wei Presentation Quickling Pagecache
 
Assignment 2 - Power drill Grapevine "It's like Yik Yak, but for opinions ab...
Assignment 2 - Power drill Grapevine  "It's like Yik Yak, but for opinions ab...Assignment 2 - Power drill Grapevine  "It's like Yik Yak, but for opinions ab...
Assignment 2 - Power drill Grapevine "It's like Yik Yak, but for opinions ab...
 
Development withforce
Development withforceDevelopment withforce
Development withforce
 
Software Portfolio - SetFocus
Software Portfolio - SetFocusSoftware Portfolio - SetFocus
Software Portfolio - SetFocus
 
High performance coding practices code project
High performance coding practices code projectHigh performance coding practices code project
High performance coding practices code project
 
St Hilaire Ajax Start Odtug Nov 2009
St Hilaire   Ajax Start Odtug Nov 2009St Hilaire   Ajax Start Odtug Nov 2009
St Hilaire Ajax Start Odtug Nov 2009
 
ASP.NET Lecture 2
ASP.NET Lecture 2ASP.NET Lecture 2
ASP.NET Lecture 2
 
Introduction To Mvc
Introduction To MvcIntroduction To Mvc
Introduction To Mvc
 
Affordable Workflow Options for APEX
Affordable Workflow Options for APEXAffordable Workflow Options for APEX
Affordable Workflow Options for APEX
 
Web Slices
Web SlicesWeb Slices
Web Slices
 
An introduction to Microsoft Graph for developers
An introduction to Microsoft Graph for developersAn introduction to Microsoft Graph for developers
An introduction to Microsoft Graph for developers
 
JS digest. January 2018
JS digest. January 2018 JS digest. January 2018
JS digest. January 2018
 
ASP.NET AJAX with Visual Studio 2008
ASP.NET AJAX with Visual Studio 2008ASP.NET AJAX with Visual Studio 2008
ASP.NET AJAX with Visual Studio 2008
 
senior software developer .net
senior software developer .netsenior software developer .net
senior software developer .net
 
PnP Webcast - Sharepoint Access App scanner
PnP Webcast - Sharepoint Access App scannerPnP Webcast - Sharepoint Access App scanner
PnP Webcast - Sharepoint Access App scanner
 
Rapid Development With CakePHP
Rapid Development With CakePHPRapid Development With CakePHP
Rapid Development With CakePHP
 
Building Restful Web App Rapidly in CakePHP
Building Restful Web App Rapidly in CakePHPBuilding Restful Web App Rapidly in CakePHP
Building Restful Web App Rapidly in CakePHP
 
Backup Exec Partner Toolkit
Backup Exec Partner ToolkitBackup Exec Partner Toolkit
Backup Exec Partner Toolkit
 

Recently uploaded

Embedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoringEmbedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoring
IJECEIAES
 
Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...
IJECEIAES
 
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
Gino153088
 
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student MemberIEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
VICTOR MAESTRE RAMIREZ
 
Curve Fitting in Numerical Methods Regression
Curve Fitting in Numerical Methods RegressionCurve Fitting in Numerical Methods Regression
Curve Fitting in Numerical Methods Regression
Nada Hikmah
 
132/33KV substation case study Presentation
132/33KV substation case study Presentation132/33KV substation case study Presentation
132/33KV substation case study Presentation
kandramariana6
 
Engineering Standards Wiring methods.pdf
Engineering Standards Wiring methods.pdfEngineering Standards Wiring methods.pdf
Engineering Standards Wiring methods.pdf
edwin408357
 
Properties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptxProperties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptx
MDSABBIROJJAMANPAYEL
 
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Sinan KOZAK
 
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
IJECEIAES
 
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
nedcocy
 
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
IJECEIAES
 
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 08 Doors and Windows.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 08 Doors and Windows.pdf2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 08 Doors and Windows.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 08 Doors and Windows.pdf
Yasser Mahgoub
 
AI for Legal Research with applications, tools
AI for Legal Research with applications, toolsAI for Legal Research with applications, tools
AI for Legal Research with applications, tools
mahaffeycheryld
 
AI + Data Community Tour - Build the Next Generation of Apps with the Einstei...
AI + Data Community Tour - Build the Next Generation of Apps with the Einstei...AI + Data Community Tour - Build the Next Generation of Apps with the Einstei...
AI + Data Community Tour - Build the Next Generation of Apps with the Einstei...
Paris Salesforce Developer Group
 
Design and optimization of ion propulsion drone
Design and optimization of ion propulsion droneDesign and optimization of ion propulsion drone
Design and optimization of ion propulsion drone
bjmsejournal
 
Gas agency management system project report.pdf
Gas agency management system project report.pdfGas agency management system project report.pdf
Gas agency management system project report.pdf
Kamal Acharya
 
Mechanical Engineering on AAI Summer Training Report-003.pdf
Mechanical Engineering on AAI Summer Training Report-003.pdfMechanical Engineering on AAI Summer Training Report-003.pdf
Mechanical Engineering on AAI Summer Training Report-003.pdf
21UME003TUSHARDEB
 
ITSM Integration with MuleSoft.pptx
ITSM  Integration with MuleSoft.pptxITSM  Integration with MuleSoft.pptx
ITSM Integration with MuleSoft.pptx
VANDANAMOHANGOUDA
 
Welding Metallurgy Ferrous Materials.pdf
Welding Metallurgy Ferrous Materials.pdfWelding Metallurgy Ferrous Materials.pdf
Welding Metallurgy Ferrous Materials.pdf
AjmalKhan50578
 

Recently uploaded (20)

Embedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoringEmbedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoring
 
Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...
 
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
 
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student MemberIEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
 
Curve Fitting in Numerical Methods Regression
Curve Fitting in Numerical Methods RegressionCurve Fitting in Numerical Methods Regression
Curve Fitting in Numerical Methods Regression
 
132/33KV substation case study Presentation
132/33KV substation case study Presentation132/33KV substation case study Presentation
132/33KV substation case study Presentation
 
Engineering Standards Wiring methods.pdf
Engineering Standards Wiring methods.pdfEngineering Standards Wiring methods.pdf
Engineering Standards Wiring methods.pdf
 
Properties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptxProperties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptx
 
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
 
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
 
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
 
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
 
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 08 Doors and Windows.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 08 Doors and Windows.pdf2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 08 Doors and Windows.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 08 Doors and Windows.pdf
 
AI for Legal Research with applications, tools
AI for Legal Research with applications, toolsAI for Legal Research with applications, tools
AI for Legal Research with applications, tools
 
AI + Data Community Tour - Build the Next Generation of Apps with the Einstei...
AI + Data Community Tour - Build the Next Generation of Apps with the Einstei...AI + Data Community Tour - Build the Next Generation of Apps with the Einstei...
AI + Data Community Tour - Build the Next Generation of Apps with the Einstei...
 
Design and optimization of ion propulsion drone
Design and optimization of ion propulsion droneDesign and optimization of ion propulsion drone
Design and optimization of ion propulsion drone
 
Gas agency management system project report.pdf
Gas agency management system project report.pdfGas agency management system project report.pdf
Gas agency management system project report.pdf
 
Mechanical Engineering on AAI Summer Training Report-003.pdf
Mechanical Engineering on AAI Summer Training Report-003.pdfMechanical Engineering on AAI Summer Training Report-003.pdf
Mechanical Engineering on AAI Summer Training Report-003.pdf
 
ITSM Integration with MuleSoft.pptx
ITSM  Integration with MuleSoft.pptxITSM  Integration with MuleSoft.pptx
ITSM Integration with MuleSoft.pptx
 
Welding Metallurgy Ferrous Materials.pdf
Welding Metallurgy Ferrous Materials.pdfWelding Metallurgy Ferrous Materials.pdf
Welding Metallurgy Ferrous Materials.pdf
 

Presentatie - Exploring the details of APEX sessions.pdf

  • 1. Exploring the details of APEX sessions APEX World 2018, Mar 22, 2018
  • 2. 21-3-2018 Exploring the details of APEX sessions 2 Menno Hoogendijk Fulltime APEX developer Working with Oracle since 2008 Tries to be a fullstack developer Speaking at: APEX World 2018 APEX Alpe Adria 2018 APEX Connect 2018 Kscope18 @mennooo mennooo About me www.menn.ooo
  • 3. 21-3-2018 Powerful JavaScript skills for APEX developers 3 Menno Hoogendijk Fulltime APEX developer Working with Oracle since 2008 Tries to be a fullstack developer My third Kscope! Plugin your APEX widgets Powerful JavaScript skills for all APEX developers @mennooo mennooo About me
  • 4. Today’s menu Introduction Creating a session The login process Session state Smaller session features The logout process
  • 5. HTTP Protocol 21-3-2018 Exploring the details of APEX sessions 5 Web server Browser HTTP request messages: GET www.google.com HTTP/1.1 User-Agent: Mozilla/5.0 Accept-Language: en-us Accept-Encoding: gzip, deflate Connection: Keep-Alive HTTP response messages: HTTP/1.1 200 OK Content-Length: 88 Content-Type: text/html Connection: Closed <html> <body> <h1>Hello, World!</h1> </body> </html>
  • 6. HTTP is stateless 21-3-2018 Exploring the details of APEX sessions 6 Web server User 2 User 3 User 1 User 4
  • 7. What is a session? 21-3-2018 Exploring the details of APEX sessions 7 “A session establishes stateful behavior across pages for each user”
  • 8. How does APEX create a session?
  • 9.
  • 10.
  • 11. The HTTP response status code 302 Found is a common way of performing URL redirection.
  • 12. What happened in APEX? 21-3-2018 Exploring the details of APEX sessions 12 1 Check if the session is valid 3 Redirect to the “session not valid URL” 2 Create a new session for user “nobody”
  • 13. 1. Check if the session is valid 21-3-2018 Exploring the details of APEX sessions 13 How depends on your Authentication Scheme If a sentry function exists, it will use that one. If a sentry function does not exist, it will use the internal one. Authentication Scheme Cookie Session ID in Request Valid?
  • 14. This is a custom Authentication Scheme
  • 16. 2. Create a new session for user “nobody” 21-3-2018 Exploring the details of APEX sessions 16 Even before login, a new session is created Tip: use apex_dictionary view select * from apex_dictionary where apex_view_name like '%SESSION%' and column_id = 0; Tip: grant role to schema to see all data grant apex_administrator_role to <SCHEMA>;
  • 17. 3. Redirect to the “session not valid URL” 21-3-2018 Exploring the details of APEX sessions 17 Only when sentry returns false
  • 18.
  • 19.
  • 20.
  • 21.
  • 23. Authentication Process 21-3-2018 Exploring the details of APEX sessions 23 apex_authentication .login Pre Authentication Authentication Post Authentication
  • 24.
  • 25.
  • 26. 21-3-2018 Plugin your APEX widgets 26 Tip: FSP_AFTER_LOGIN_URL in Post Authentication Purpose: Do not go to predefined home page, but redirect to custom URL :FSP_AFTER_LOGIN_URL := apex_page.get_url(p_page => 2)
  • 29. Update session for user “nobody” to “ADMIN” 21-3-2018 Exploring the details of APEX sessions 29
  • 30. Session State – Page Rendering
  • 31. There are different kinds of session state 21-3-2018 Exploring the details of APEX sessions 31 1 Persisted Session State 2 In Memory Session State Difference: is or is not stored in WWV_FLOW_DATA table
  • 32. In Memory Session State 21-3-2018 Exploring the details of APEX sessions 32 2 Page item default value 1 Automatic Row Fetch 3 Page item source value
  • 34. Persisted Session State 21-3-2018 Exploring the details of APEX sessions 34 2 PL/SQL Process 1 Computation
  • 35. Persisted Session State - When does the commit take place? 21-3-2018 Exploring the details of APEX sessions 35 3 If no item value has changed -> end of page rendering 2 If item value has changed -> end of block 1 If item value has changed using apex_util.set_session_state -> immediately
  • 37. Session State – Page Processing
  • 38. What’s new in 5.1 21-3-2018 Exploring the details of APEX sessions 38 2 Reload on submit 1 Always via JSON (using XMLHttpRequest)
  • 39. Always submit via JSON Processed via APEX_APPLICATION.ACCEPT Original JSON in APEX_JSON variables
  • 40. XMLHttpRequest page submits and the 32k limitation 21-3-2018 Exploring the details of APEX sessions 40 People often mix up three limitations on 32K. • 32K was the max size of a report row • 32K is the max size of an APEX item • mod_plsql limits the size of a single parameter that can be passed to a procedure to 32K. (ORDS does not have this limitation) Doing asynchronous page submits in 5.1 only solves the limitation for mod_plsql because XMLHttpRequest supports chunked uploads.
  • 41. Solutions for CLOBs (POST requests) 21-3-2018 Exploring the details of APEX sessions 41 2 apex.ajax.clob 1 Use an editable Interactive Grid var ajaxClob = new apex.ajax.clob() ajaxClob._set('very long text..') select clob001 from apex_collections where collection_name = 'CLOB_CONTENT’;
  • 42. Reload on submit 21-3-2018 Exploring the details of APEX sessions 42 2 Only for success 1 Always
  • 43. When reload on submit is set to always, APEX will process the page synchronous
  • 44. When reload on submit is set to only for success, APEX will process the page asynchronous The request returns a URL in JSON format apex.navigation.redirect( responseData.redirectURL );
  • 45. Tip: Do not use Reload on Submit set Only for Success in combination with Enable Duplicate Page Submissions set to No This will result in an error when first submit is not successful
  • 48. Rejoin sessions 21-3-2018 Exploring the details of APEX sessions 48 When is it useful? • User is already working in application • Opens a link to the same application in another tab □ Via link in email □ Via bookmark □ Other..
  • 50. 21-3-2018 Plugin your APEX widgets 50 Rejoin sessions needs to be enabled in the Instance Administration
  • 53. APEX session isolation between multiple browser tabs 21-3-2018 Exploring the details of APEX sessions 53 When is it useful? • When you depend on page/ application items that are not part of page submission • For example: an application item that holds a certain context value □ Tab 1: Context is customer A □ Tab 2: Context is customer B • Security risks are not fully guaranteed yet, therefore option is disabled by default
  • 54. Step 1: enable feature 21-3-2018 Exploring the details of APEX sessions 54 begin apex_instance_admin.set_parameter( p_parameter => 'CLONE_SESSION_ENABLED', p_value => 'Y' ); end;
  • 55. Step 2: add navigation bar list entry for this URL 21-3-2018 Exploring the details of APEX sessions 55 f?p=&APP_ID.:&APP_PAGE_ID.:&APP_SESSION.:APEX_CLONE_SESSION
  • 57.
  • 61.
  • 62.
  • 63.
  • 64. You can purge all instance sessions