PHP code example of cyrill / sucre-session

1. Go to this page and download the library: Download cyrill/sucre-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/ */

    

cyrill / sucre-session example snippets



reqire __DIR__.'/composer/autoload.php';

use Sucre\Session;

Session::init($regenerate = true); // start session

Session::set('foo', 'bar'); // $_SESSION['foo'] = 'bar';
Session::get('foo'); // returns 'bar'

Session::setFlash('foofoo', 'barbar');
Session::getFlash('foofoo'); // returns 'barbar'

Session::generateId();
Session::destroy();