PHP code example of birkanoruc / session-helper

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

    

birkanoruc / session-helper example snippets


Birkanoruc\SessionHelper\Session::start();

session_start();

use Birkanoruc\SessionHelper\Session;

if (Session::has('user_id')) {
    // Do something
}

Session::put('user_id', 123);

$userId = Session::get('user_id');

Session::flash('message', 'User created successfully!');

Session::unflash();

Session::destroy();