chipslays / session
Easy Session manage
1.0.2
2021-02-15 09:27 UTC
This package is auto-updated.
Last update: 2024-12-15 17:53:37 UTC
README
Easy way for manage Session on your website.
Installation
composer require chipslays/session
Usage
use Session\Session; require 'vendor/autoload.php'; Session::start([ 'name' => 'PHPSSID_CUSTOM_NAME', 'cookie_lifetime' => 86400, // seconds ]);
See more available options here.
Session::set('name', 'chipslays');
Session::get('name'); // second parameter is default value Session::get('name', 'Unknown name');
Session::pull('name');
Session::has('name'); // true Session::has('email'); // false
Session::remove('name');
Session::clear();
$sessionId = Session::id();
Session::regenerate();