Previous Next JavaScript must be enabled to correctly display this content

## 21.2.3 About Session State and Security

Learn about managing session state and security.

Oracle APEX persists session state in database tables. Session state is preserved in database tables because it is more secure to store the session state on the server side than on the client. Because APEX applications use the stateless HTTP protocol, an application's session state across multiple page views is preserved in database tables. Not maintaining a synchronous database connection for each APEX application user significantly lessens memory and database resource requirements.

Developers can query the session state stored by APEX applications using the App Builder and built-in monitoring pages. Developers and administrators can access session state for any application in the workspace to which they are authenticated.

Developer best practices for managing session state include:

- As a standard part of implementing program control flow, clear the session state of unneeded values using clear-cache page processes or clear-cache directives in URLs used to navigate to pages.
- Use password page item types that do not save state. This prevents the entered passwords from being saved in session state tables in the database.
- When sensitive data must persist in a session, it should be saved in APEX session state tables in encrypted form. To use this feature, set the page item's Store value encrypted in session state attribute to On. Encrypted stored values are automatically decrypted when read.

Note:

The objective of encrypted session state is to persist session state such that the unencrypted values cannot be read by other APEX developers or database administrators who might have access to the APEX session state tables, debug output, or database data files. Oracle recommends that database backups be performed using facilities that encrypt data in the backup files.

Tip:

You can encrypt item values up to 4000 bytes in length. Attempts to encrypt values longer than 4000 bytes produces an error message.

Parent topic: Understanding Developer Security Best Practices