PHPackages                             reaway/think-cookie - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. reaway/think-cookie

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

reaway/think-cookie
===================

think cookie

v1.0.1(4y ago)0231Apache-2.0PHPPHP &gt;=7.2.0

Since Feb 4Pushed 4y ago1 watchersCompare

[ Source](https://github.com/reaway/think-cookie)[ Packagist](https://packagist.org/packages/reaway/think-cookie)[ Docs](https://github.com/reaway/think-cookie)[ RSS](/packages/reaway-think-cookie/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (3)Versions (3)Used By (1)

think-cookie
============

[](#think-cookie)

安装
--

[](#安装)

```
composer require reaway/think-cookie
```

用法
--

[](#用法)

```
use Think\Component\Cookie\Facade\Cookie;

require __DIR__ . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php';

// 设置Cookie 有效期为3600秒
Cookie::set('name', 'value', 3600);

// 永久保存Cookie
Cookie::forever('name', 'value');

// 删除cookie
Cookie::delete('name');

// 读取某个cookie数据
Cookie::get('name');
// 获取全部cookie数据
Cookie::get();

// 助手函数
// 设置
cookie('name', 'value', 3600);

// 获取
echo cookie('name');

// 删除
cookie('name', null);

// 保存本次Cookie
Cookie::save();
```

文档
--

[](#文档)

详细参考 [Cookie](https://www.kancloud.cn/manual/thinkphp6_0/1037636)

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~14 days

Total

2

Last Release

1548d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d342ebe348631bdfbe41ebcd414f0b5fa2334027d413e3543afb301f3503a13f?d=identicon)[reaway](/maintainers/reaway)

---

Top Contributors

[![reaway](https://avatars.githubusercontent.com/u/60423559?v=4)](https://github.com/reaway "reaway (6 commits)")

### Embed Badge

![Health badge](/badges/reaway-think-cookie/health.svg)

```
[![Health](https://phpackages.com/badges/reaway-think-cookie/health.svg)](https://phpackages.com/packages/reaway-think-cookie)
```

###  Alternatives

[comocode/laravel-ab

Blade level AB tests for Laravel 5

3339.4k](/packages/comocode-laravel-ab)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
