PHP code example of geggleto / psr7-session

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

    

geggleto / psr7-session example snippets


$app->add(new \Geggleto\Middleware\Session('session_name'));

//In your Session you have
[
    'user' => 1
]

//Then in your Request Object, if you want your User ID...

$request->getAttribute('user') === 1