PHPackages                             hxgf/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. hxgf/cookie

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

hxgf/cookie
===========

PHP functions to handle cookie operations more easily.

1.1.0(3y ago)0432MITPHP

Since May 6Pushed 1y ago1 watchersCompare

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

READMEChangelog (3)DependenciesVersions (4)Used By (2)

[![](https://raw.githubusercontent.com/jyoungblood/vphp.dev/refs/heads/master/public/vphp-logo-100.png)](https://vphp.dev)

Cookie
======

[](#cookie)

### Vanilla PHP functions to more easily handle cookie operations.

[](#vanilla-php-functions-to-more-easily-handle-cookie-operations)

Installation
============

[](#installation)

Easy install with composer:

```
composer require jyoungblood/cookie

```

```
use VPHP\cookie;
require __DIR__ . '/vendor/autoload.php';
```

Usage
=====

[](#usage)

cookie::set($key, $value, $parameters)
--------------------------------------

[](#cookiesetkey-value-parameters)

Sets a cookie with a specific key for a specific amount of time. Native PHP [setcookie()](https://www.php.net/manual/en/function.setcookie.php) 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)
-----------------

[](#cookiegetkey)

Returns the value of a specific cookie.

```
echo cookie::get('user_name');
```

cookie::delete($key)
--------------------

[](#cookiedeletekey)

Deletes a specific cookie.

```
cookie::delete('user_name');
```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance30

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity50

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 ~128 days

Total

3

Last Release

1215d ago

Major Versions

0.1.0 → 1.0.02022-05-20

### Community

Maintainers

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

---

Top Contributors

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

---

Tags

abstractioncookiesutilities

### Embed Badge

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

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

###  Alternatives

[willdurand/geocoder

Common files for PHP Geocoder

17435.7M159](/packages/willdurand-geocoder)[vaimo/composer-patches

Applies a patch from a local or remote file to any package that is part of a given composer project. Patches can be defined both on project and on package level. Optional support for patch versioning, sequencing, custom patch applier configuration and patch command for testing/troubleshooting added patches.

2994.3M16](/packages/vaimo-composer-patches)[lodash-php/lodash-php

A port of Lodash to PHP

527719.0k5](/packages/lodash-php-lodash-php)[whitecube/laravel-cookie-consent

Register, configure and ask for cookies consent in a EU-compliant way.

489563.9k1](/packages/whitecube-laravel-cookie-consent)[kartik-v/yii2-helpers

A collection of useful helper functions for Yii Framework 2.0

883.0M29](/packages/kartik-v-yii2-helpers)[longman/ip-tools

PHP IP Tools for manipulation with IPv4 and IPv6

147245.6k6](/packages/longman-ip-tools)

PHPackages © 2026

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