wplibs / session
The missing session handler in WordPress
Installs: 1 164
Dependents: 1
Suggesters: 1
Security: 0
Stars: 3
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: >=5.5.9
- tightenco/collect: 5.2.*|5.3.*|5.4.*
Requires (Dev)
- mockery/mockery: ^0.9|^1.0
- phpunit/phpunit: 4.8.*|5.7.*
This package is auto-updated.
Last update: 2019-03-18 05:01:31 UTC
README
The missing Session manager for WordPress
Installation
composer require wplibs/session:^1.0
Usage
<?php use WPLibs\Session\WP_Session; $session = new WP_Session('my_plugin_session', [ 'lifetime' => 1440, // The session lifetime in minutes. 'expire_on_close' => false, // If true, the session immediately expire on the browser closing. 'cookie_name' => null, ]); // Must call before the `init` hook. $session->hooks(); // In some where: $session['user_address'] = 'Some where'; // Retrive dump($session['user_address']);