Skip to content

Latest commit

 

History

History
60 lines (43 loc) · 817 Bytes

readme.md

File metadata and controls

60 lines (43 loc) · 817 Bytes

PHP Session

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();