PHP code example of okayinc / stateless-session
1. Go to this page and download the library: Download okayinc/stateless-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/ */
okayinc / stateless-session example snippets
use OKayInc;
$session_id = md5($from_user_id.'@'.$chat_id); // something unique
\OKayInc\StatelessSession::start($session_id);
// To restart the session (forget the pass)
\OKayInc\StatelessSession::reset();
// To get/remember a value in different HTTP sessions. If $index does not exist, $default_value is returned.
// $default_value is optional, if omited, NULL is used insted.
$setup_step = \OKayInc\StatelessSession::get($index, $default_value);
// To set $index to $value
\OKayInc\StatelessSession::set($index, $value);