PHPackages                             letnn/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. [Security](/categories/security)
4. /
5. letnn/cookie

ActiveLibrary[Security](/categories/security)

letnn/cookie
============

cookie组件 使用Jwt加密cookie数据提高网站安全性

1.0(3y ago)0321MITPHPPHP &gt;=7.1

Since Mar 16Pushed 3y ago1 watchersCompare

[ Source](https://github.com/letnn/cookie)[ Packagist](https://packagist.org/packages/letnn/cookie)[ RSS](/packages/letnn-cookie/feed)WikiDiscussions main Synced today

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

cookie管理组件
==========

[](#cookie管理组件)

使用Jwt加密cookie数据提高网站安全

开始使用
====

[](#开始使用)

#### 安装

[](#安装)

使用 composer 命令进行安装或下载源代码使用。

```
composer require letnn/cookie

```

#### Cookie配置

[](#cookie配置)

```
\letnn\Cookie::config([
    // cookie 保存时间
    'expire'   => 0,
    // cookie 保存路径
    'path'     => '/',
    // cookie 有效域名
    'domain'   => '',
    //  cookie 启用安全传输
    'secure'   => true,
    //  cookie 安全传输密钥
    'secure_key' => 'LangShen',
    //  cookie 前缀
    'prefix' => 'letphp_'
]);
```

#### 调用示例

[](#调用示例)

```
use letnn\Cookie;

// 设置
Cookie::set("app", "LangShen", 3600, "/", "qq.com");

// 检测
print Cookie::has("app") ? "存在" : "不存在";

// 获取
print Cookie::get("app");

// 全部
print Cookie::all();

// 删除
Cookie::delete("app");

// 清空
Cookie::flush();
```

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity40

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

Unknown

Total

1

Last Release

1204d ago

### Community

Maintainers

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

---

Top Contributors

[![letnn](https://avatars.githubusercontent.com/u/122198198?v=4)](https://github.com/letnn "letnn (11 commits)")

---

Tags

cookieletnn

### Embed Badge

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

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

###  Alternatives

[mews/purifier

Laravel 5/6/7/8/9/10 HtmlPurifier Package

2.0k18.7M143](/packages/mews-purifier)[aidantwoods/secureheaders

A PHP class aiming to make the use of browser security features more accessible.

434731.2k2](/packages/aidantwoods-secureheaders)[devrabiul/laravel-cookie-consent

A GDPR-compliant cookie consent solution for Laravel applications with fully customizable cookie banners, granular consent control, and enterprise-grade compliance features.

18355.4k1](/packages/devrabiul-laravel-cookie-consent)[selective/samesite-cookie

Secure your site with SameSite cookies

10145.9k](/packages/selective-samesite-cookie)[paragonie/ecc

PHP Elliptic Curve Cryptography library

24820.0k37](/packages/paragonie-ecc)

PHPackages © 2026

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