会话组件提供基本方法来处理会话。

v1.1.1 2018-06-26 15:16 UTC

This package is auto-updated.

Last update: 2024-09-25 10:10:43 UTC


README

version MIT License

安装

composer require flextype-components/session

使用

启动会话。

Session::start();

删除一个或多个会话变量。

Session::delete('user');

销毁会话。

Session::destroy();

检查是否存在会话变量。

if (Session::exists('user')) {
    // Do something...
}

获取存储在会话中的变量。

echo Session::get('user');

返回sessionID。

echo Session::getSessionId();

在会话中存储一个变量。

Session::set('user', 'Awilum');

许可证

查看 LICENSE