PHP code example of snicco / session-wp-bridge
1. Go to this page and download the library: Download snicco/session-wp-bridge library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
snicco / session-wp-bridge example snippets
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();
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');