PHP code example of sun / session

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

    

sun / session example snippets


 

$session = new Sun\Session;
$session->create('login', 'username');

$session->get('login');

$session->get('login', 'users');

$session->get('login');

$session->has('login');

$session->pull('login');

$session->pull('login','users');

$session->push('login', ['user']);

$session->pop('login');

$session->shift('login');

$session->destroy();