ezeasorekene/php-cookie-manager 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

ezeasorekene/php-cookie-manager

最新稳定版本:v2.1.1

Composer 安装命令:

composer require ezeasorekene/php-cookie-manager

包简介

This class provides methods to manage cookies in PHP applications.

README 文档

README

This class provides methods to manage cookies in PHP applications.

Latest Version on Packagist License: MIT

This PHP class provides convenient methods to manage cookies in web applications.

Installation

You can install this package using Composer:

composer require ezeasorekene/php-cookie-manager

Usage

// Get the value of a cookie
$username = Cookie::get('username');

// Set a cookie with custom options
Cookie::set('user_id', 123, ['expires' => time() + 3600, 'secure' => true]);

// Check if a cookie exists
if (Cookie::has('token')) {
    // Perform an action
}

// Destroy a cookie
Cookie::destroy('session_id');

Methods

get($name)
Get the value of a cookie.

set($name, $value, $options = [])
Set a cookie.

setMultiple($cookies, $options = [])
Set multiple cookies.

has($name)
Check if a cookie exists.

destroy($name, $options = [])
Destroy a cookie.

destroyMultiple($cookies, $options = [])
Destroy multiple cookies.

jsonSet($name, $value, $options = [])
Set a JSON-encoded cookie.

jsonGet($name, $assoc = false)
Get the JSON-decoded value of a cookie.

jsonHas($name)
Check if a JSON-encoded cookie exists.

jsonDestroy($name, $options = [])
Destroy a JSON-encoded cookie.

jsonDestroyMultiple($cookies, $options = [])
Destroy multiple JSON-encoded cookies.

Contributing

If you'd like to contribute, please fork the repository and make your changes. Pull requests are warmly welcome.

License

This package is licensed under the MIT License.

Author

Ezeasor Ekene

Contact

For inquiries, please email me at ezeasorekene@gmail.com

Copyright

© 2023 Ezeasor Ekene. All rights reserved.

统计信息

  • 总下载量: 36
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-03-03