instantech / session
This package is a simple encapsulation of PHP natif $_SESSION to Object Representation
1
2019-11-11 09:38 UTC
Requires
- php: >=7.1.0
This package is auto-updated.
Last update: 2025-04-11 22:50:44 UTC
README
This is a basic implementation of PHP super Global $_SESSION to Object representation. This package implement the flash message interface
Requirements
- php >=7.1.0
Installation
- Installation
$ composer require instantech/session
- Usage
<?php require_once __DIR__.'/vendor/autoload.php'; use Instantech\Session; session_start(); //Set value in the session with key test Session::set("test", 'value'); //Get value matched key test Session::get('test'); //Set a flash message with key success and value IT's success Session::addFlash('success', "IT's succes"); //Read the flash message with key success echo Session::flash('success'); //Clear all information in the session Session::clear(); //Get an array of all value in the session Session::all(); //Check if some key test exist in the session Session::has('test'); //Check if some key success exist in the flash message Session::hasFlash('success'); //Remove the value from the session with key test Session::remove('test');