WordPress plugin intelligence profile

Native PHP Sessions

Use native PHP sessions and stay horizontally scalable. Better living through superior technology.

WP PlugIndex snapshot

Current directory snapshot

Tested up to WordPress 6.9
Current version1.4.5
WordPress coverageTested up to WordPress 6.9
Minimum stackWP 5.3 · PHP 7.4
Directory statusactive
Last directory update4 Dec 202511mo ago
Active installations10K+Adoption metric — not a quality score
WordPress.org rating4.9 / 5 from 16 ratings
Official packageDirect from WordPress.org

Repository metrics are context, not quality scores. Active installations measure adoption and can strongly reflect a plugin’s age and historical popularity. Ratings, recent updates and “Tested up to” metadata also do not guarantee modern code, error-free operation, security, feature completeness or suitability for a particular site. Why active installs don’t tell the whole story →

WP PlugIndex currently records Native PHP Sessions version 1.4.5 as active, updated 11mo ago and tested up to WordPress 6.9.

Overview

About this plugin

WordPress core does not use PHP sessions, but sometimes they are required by your use-case, a plugin or theme.

This plugin implements PHP’s native session handlers, backed by the WordPress database. This allows plugins, themes, and custom code to safely use PHP $_SESSION s in a distributed environment where PHP’s default tempfile storage just won’t work.

Note that primary development is on GitHub if you would like to contribute:

com/pantheon-systems/wp-native-php-sessions

Configuration

By default the session lifetime is set to 0, which is until the browser is closed.

To override this use the pantheon_session_expiration filter before the Native PHP Sessions plugin is loaded. a. mu-plugin) could contain:

php function my_session_expiration_override() { return 60*60*4; // 4 hours } add_filter( 'pantheon_session_expiration', 'my_session_expiration_override' );<h3>CLI Commands</h3>

wp pantheon session add-index

0. 2. You will be automatically notified when you visit any admin page if this is the case.

If there’s no message, your version is good to go. Note that this command is non-destructive, a new table will be created and the existing one preserved in a backup state until you have verified that the upgrade is functioning as expected.

wp pantheon session primary-key-finalize

0. If you have run the add-index command and have verified that the new table is functioning correctly, running the primary-key-finalize command will perform a database cleanup and remove the backup table.

wp pantheon session primary-key-revert

0. If you have run the add-index command and something unexpected has occurred, just run the primary-key-revert command and the backup table will immediately be returned to being the active table.

WordPress Multisite

2 the add-index, primary-key-add and primary-key-revert commands are fully multisite compatible.

Contributing

md for information on contributing.

Troubleshooting

”, then you likely have a plugin that is starting a session before WP Native PHP Sessions is loading.

php and include the following:

php if (file_exists(WP_PLUGIN_DIR. php')) { require_once WP_PLUGIN_DIR. php'; }

This mu-plugin will load WP Native PHP Sessions before all other plugins, while letting you still use the WordPress plugin updater to keep the plugin up-to-date.

WordPress.org metadata

Plugin tags

Topics listed for this plugin in the WordPress.org directory.

  • comments
  • sessions
Compatibility & maintenance

Compatibility & maintenance

Tested up to WordPress 6.9

Not yet marked as tested with WordPress 7.1. WordPress.org currently lists Tested up to 6.9.

Current WordPress releaseWordPress 7.1
WordPress.org Tested up to6.9
Minimum requirementsWordPress 5.3 · PHP 7.4
Update activity4 Dec 202511mo ago

“Tested up to” is directory metadata supplied by the plugin author. WP PlugIndex does not turn an older declaration into a claim that the plugin is incompatible.

Changes recorded by WP PlugIndex

Recent tracked changes

No tracked version or compatibility changes have been recorded by WP PlugIndex yet.

Tracking & source

WP PlugIndex tracks public WordPress.org directory metadata and records selected version, compatibility and availability changes as they are detected.

Plugin watchlist

Watch this plugin

Sign in to your WP PlugIndex account or create a free account. Free accounts can watch up to 5 plugins and see what changed.

Watch limit

Watchlist limit reached

You have reached your current active watch limit.