Skip to content

⏱ Easy way for manage Session on your website.

Notifications You must be signed in to change notification settings

chipslays/session

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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