PHP code example of abclove / session
1. Go to this page and download the library: Download abclove/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/ */
abclove / session example snippets
//建议写到config/di.php里面
\PhalApi\DI()->session = new \Abclove\Session\Lite();
//设置:
\PhalApi\DI()->session->你的自定义字段名称=值;
//获取:
$val = \PhalApi\DI()->session->你的自定义字段名称;
//销毁:
\PhalApi\DI()->destroy()
//获取session_id
$val = \PhalApi\DI()->session_id;