jyoungblood/cookie
最新稳定版本:1.1.0
Composer 安装命令:
composer require jyoungblood/cookie
包简介
PHP functions to handle cookie operations more easily.
README 文档
README
Cookie
Vanilla PHP functions to more easily handle cookie operations.
Installation
Easy install with composer:
composer require jyoungblood/cookie
use VPHP\cookie; require __DIR__ . '/vendor/autoload.php';
Usage
cookie::set($key, $value, $parameters)
Sets a cookie with a specific key for a specific amount of time. Native PHP setcookie() parameters are allowed. All parameters are optional.
cookie::set('user_name', 'Buzz', [ 'expires' => time() + 86400, // unix time, default is 1 year 'path' => '/custom-path/', // default is '/' 'domain' => 'custom.example.com', 'secure' => true, 'httponly' => true, 'samesite' => 'Lax', ]);
cookie::get($key)
Returns the value of a specific cookie.
echo cookie::get('user_name');
cookie::delete($key)
Deletes a specific cookie.
cookie::delete('user_name');
统计信息
- 总下载量: 31
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 5
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-03-22
