PHPackages                             kegi/netscape-cookie-file-handler - 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. kegi/netscape-cookie-file-handler

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

kegi/netscape-cookie-file-handler
=================================

Netscape Cookie File Handler

1.0.3(10y ago)239.3k↓44%3GPL-3.0PHPPHP &gt;=7.0

Since Feb 16Pushed 3y ago2 watchersCompare

[ Source](https://github.com/kegi/netscape-cookie-file-handler)[ Packagist](https://packagist.org/packages/kegi/netscape-cookie-file-handler)[ RSS](/packages/kegi-netscape-cookie-file-handler/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (6)Used By (0)

Netscape Cookie File Handler
============================

[](#netscape-cookie-file-handler)

[![Build Status](https://camo.githubusercontent.com/947ba8a275179840f4b5fb85948e8c25c6d8a3c0959d026de28c1b7abd82c057/68747470733a2f2f7472617669732d63692e6f72672f6b6567692f6e657473636170652d636f6f6b69652d66696c652d68616e646c65722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/kegi/netscape-cookie-file-handler)[![Latest Stable Version](https://camo.githubusercontent.com/ee944348c76a1b745f80b763baba71e2033afd09f9918e8a04d7d8eee23ff6a0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6b6567692f6e657473636170652d636f6f6b69652d66696c652d68616e646c65722e7376673f7374796c653d666c6174)](https://packagist.org/packages/kegi/netscape-cookie-file-handler)[![Test Coverage](https://camo.githubusercontent.com/b55be2a0c1e3714a26dc56878ae64c2ab24c39d3ef94d6efca9ce474d0272c83/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f6b6567692f6e657473636170652d636f6f6b69652d66696c652d68616e646c65722f6261646765732f636f7665726167652e737667)](https://codeclimate.com/github/kegi/netscape-cookie-file-handler/coverage)

[![Issue Count](https://camo.githubusercontent.com/83651ffa6962fa29db080c581efb54838844cf467a4ecd994b1e97c3dce08e7c/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f6b6567692f6e657473636170652d636f6f6b69652d66696c652d68616e646c65722f6261646765732f69737375655f636f756e742e737667)](https://codeclimate.com/github/kegi/netscape-cookie-file-handler)[![Code Climate](https://camo.githubusercontent.com/b7cdf765a6007ec6d7169ec6528d87d03077a9b40c2d93ff0b07d5dc12b1896d/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f6b6567692f6e657473636170652d636f6f6b69652d66696c652d68616e646c65722f6261646765732f6770612e737667)](https://codeclimate.com/github/kegi/netscape-cookie-file-handler)[![SensioLabsInsight](https://camo.githubusercontent.com/ad51cb1820bf4dc928214652cc16cd592dd3a2ef3087c7418b73635c55d47ce0/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f39656364373266322d613436332d346563612d396335352d3437333364393336373533662f6d696e692e706e67)](https://insight.sensiolabs.com/projects/9ecd72f2-a463-4eca-9c55-4733d936753f)

This library allows you to manipulate Netscape Cookie File (eg. Cookies generated by CURL).

---

Requirements
------------

[](#requirements)

This is library is only available for **PHP7+**There is no other dependencies

Installation
------------

[](#installation)

This library is available on packagist (**Composer**)

```
composer require kegi/netscape-cookie-file-handler
```

What are Cookies Files ?
------------------------

[](#what-are-cookies-files-)

The Netscape cookie files are widely used. Curl, by example, allows you to select a file (called the cookie jar) to save and read the cookies using this format. This library will help you to manipulate and read those cookies.

Example
-------

[](#example)

Simple example of reading + writing cookies

```
/*Open and parse the cookie file*/

$configuration = (new Configuration())->setCookieDir('cookies/');
$cookieJar = (new CookieFileHandler($configuration))->parseFile('my_cookie_file');

/*Add (and save) a cookie*/

$cookieJar->add(
    (new Cookie())
        ->setHttpOnly(true)
        ->setPath('/foo')
        ->setSecure(true)
        ->setExpire(new DateTime('2020-02-20 20:20:02'))
        ->setName('foo')
        ->setValue('bar')
)->persist();
```

Documentation
-------------

[](#documentation)

Learn how to use the library here : [documentation](/docs/README.md).

Contribution
------------

[](#contribution)

Feel free to contact me or send pull requests !

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity35

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 99% 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 ~1 days

Total

4

Last Release

3741d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7944de1e24485054fb54b0b8286fe1ea1209805109f624dcc7a65e2a598584db?d=identicon)[kegi](/maintainers/kegi)

---

Top Contributors

[![kegi](https://avatars.githubusercontent.com/u/6678421?v=4)](https://github.com/kegi "kegi (98 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")

---

Tags

cookienetscapecookie file

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/kegi-netscape-cookie-file-handler/health.svg)

```
[![Health](https://phpackages.com/badges/kegi-netscape-cookie-file-handler/health.svg)](https://phpackages.com/packages/kegi-netscape-cookie-file-handler)
```

###  Alternatives

[spatie/laravel-cookie-consent

Make your Laravel app comply with the crazy EU cookie law

1.5k4.7M20](/packages/spatie-laravel-cookie-consent)[statikbe/laravel-cookie-consent

Cookie consent modal for EU

213396.7k](/packages/statikbe-laravel-cookie-consent)[oveleon/contao-cookiebar

Contao Cookiebar

63124.1k6](/packages/oveleon-contao-cookiebar)[dirkpersky/typo3-dp_cookieconsent

Enable a cookie consent box. Let you visitors control the usage of cookies and load script or content after a consent. (ePrivacy, TTDSG)

36201.3k1](/packages/dirkpersky-typo3-dp-cookieconsent)[xsuchy09/utm-cookie

Utm-Cookie saves utm parameters from url into cookie with defined lifetime (default 7 days). Than cookie (utm) can be used later without parsing google or any other cookies.

1456.1k2](/packages/xsuchy09-utm-cookie)[bizley/cookiemonster

Yii extension to manage cookie warning.

2020.1k1](/packages/bizley-cookiemonster)

PHPackages © 2026

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