Skip to content

[READ ONLY] Subtree split of the snicco/session-wp-bridge package (see snicco/snicco).

License

Notifications You must be signed in to change notification settings

snicco/session-wp-bridge

Repository files navigation

WordPress session drivers for snicco/session

codecov Psalm Type-Coverage Psalm level PhpMetrics - Static Analysis PHP-Versions

This package provides two WordPress specific session drivers for the snicco/session library:

Installation

composer require snicco/session-wp-bridge

Usage

WPDBSessionDriver

To use the WPDBSessionDriver you first need an instance of BetterWPDB.

use Snicco\Bridge\SessionWP\WPDBSessionDriver;
use Snicco\Component\BetterWPDB\BetterWPDB;

$driver = new WPDBSessionDriver('my_app_session', BetterWPDB::fromWpdb());

// Creates the necessary db table if it does not exist already.
$driver->createTable();

WPObjectCacheDriver

use Snicco\Bridge\SessionWP\WPObjectCacheDriver;

$idle_timeout_in_seconds /* Same value as in your session config here */

$wp_object_cache_driver = new WPObjectCacheDriver('my_app_sessions');

Contributing

This repository is a read-only split of the development repo of the Snicco project.

This is how you can contribute.

Reporting issues and sending pull requests

Please report issues in the Snicco monorepo.

Security

If you discover a security vulnerability, please follow our disclosure procedure.

About

[READ ONLY] Subtree split of the snicco/session-wp-bridge package (see snicco/snicco).

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages