PHP code example of chipslays / session

1. Go to this page and download the library: Download chipslays/session library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

chipslays / session example snippets


use Session\Session;

 'name'            => 'PHPSSID_CUSTOM_NAME',
    'cookie_lifetime' => 86400, // seconds
]);

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