temant/session-manager
最新稳定版本:v2.0.5
Composer 安装命令:
composer require temant/session-manager
包简介
A comprehensive PHP utility class for secure and efficient managing sessions.
README 文档
README
Temant Session Manager is a PHP package that simplifies session management in PHP applications. It provides an easy-to-use interface for starting and managing sessions, setting and getting session variables, and more.
Table of Contents
Installation
You can install this package via Composer: composer require temant/session-manager
Usage
To start using this package, follow these simple steps:
Require your composer autoloader:
require_once('path/to/vendor/autoload.php');
Create a SessionManager Instance:
use Temant\SessionManager\SessionManager;
Create a new session instance
$session = new SessionManager();
Start a new session:
$session->start();
Set a session variable:
$session->set('user_id', 123);
Get the value of a session variable:
$userID = $session->get('user_id');
Check if a session variable exists:
if ($session->has('user_id')) { // Do something }
Remove a session variable:
$session->remove('user_id');
Regenerate the session ID:
$session->regenerate();
Destroy the session:
$session->destroy();
统计信息
- 总下载量: 52
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-09-12