max/session

dev-master 2022-06-08 23:32 UTC

This package is auto-updated.

Last update: 2022-06-08 23:33:40 UTC


README

Session组件,支持File和Redis存储

composer require max/session:dev-master
$sessionManager = \Max\Di\Context::getContainer()->make(\Max\Session\SessionManager::class);

$session = $sessionManager->create();

$session->start($id); // 如果为null则创建id

$session->set($key, $value);

$session->get($key);

$session->save();

$session->close();