PHPackages                             rnr1721/le7-cookie-wrapper - 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. [Framework](/categories/framework)
4. /
5. rnr1721/le7-cookie-wrapper

ActiveLibrary[Framework](/categories/framework)

rnr1721/le7-cookie-wrapper
==========================

Wrapper for $\_SESSION and cookies for le7 PHP MVC framework or any PHP project

1.0.5(2y ago)01283MITPHPPHP &gt;=8.1

Since Mar 26Pushed 2y ago1 watchersCompare

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

READMEChangelogDependencies (4)Versions (6)Used By (3)

le7-cookie-wrapper
==================

[](#le7-cookie-wrapper)

Wrapper for session and cookies for le7 PHP MVC framework or any PHP project

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

[](#requirements)

- PHP 8.1 or higher.
- Composer 2.0 or higher.

What it can?
------------

[](#what-it-can)

- CRUD for cookies
- CRUD for session variables

There are set of interfaces and adapters for drive variables for $\_SESSION and $\_COOKIES:

- Core\\Interfaces\\CookieInterface interface - for cookie management
- Core\\Interfacrs\\SessionInterface interface - for session management

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

[](#installation)

```
composer require rnr1721/le7-cookie-wrapper
```

Testing
-------

[](#testing)

```
composer test
```

### Cookie adapters

[](#cookie-adapters)

- Core\\Cookies\\CookiesNative - default adapter, for use
- Core\\Cookies\\CookiesArray - data stored in array, not persistent (for testing)
- Core\\Cookies\\Cache - data stored in PSR cache (for testing)

You can write own implementation of CORE\\Interfaces\\CookieInterface All of these adapters need config, implementation of Core\\Interfaces\\CookieConfigInterface

- Core\\Cookies\\CookieConfigDefault

Of course, you can write own implementation, to load config from some source etc.

How use it?

```
use Core\Cookies\CookiesConfigDefault;
use Core\Cookies\CookiesNative;

    // This is the default config
    $newConfig = [
        'domain' => '',
        'httpOnly' => false,
        'path' => '',
        'isSecure' => false,
        'time' => 0,
        'sameSite' => 'Lax',
    ];

    // Implementation of Core\Interfaces\CookieConfigInterface
    $config = new CookiesConfigDefault($newConfig);

    // Second case to add params
    // $config->setParams($newConfig);

    // Implementation of Core\Interfaces\CookieInterface
    $cookies = new CookiesNative($config);

    // Before operations with cookies you can set more concrete params
    // These params will override defaults
    // $cookies->setPath('/');
    // $cookies->setHttpOnly(true);
    // $cookies->setSameSite('Lax');
    // $cookies->setSecure(true);
    // $cookies->setTime(3600);

    $cookies->get('mycookie'); //return cookie value by key;
    $cookies->get('mycookie','default'); //return cookie value by key or default;
    $cookies->has('mycookie'); // return bool if cookie exists or not
    $cookies->delete('mycookie'); // delete cookie
```

### Session adapters

[](#session-adapters)

Also, you can manage your session variables. It implementation of Core\\Interfaces\\SessionInterface

- Core\\Session\\SessionNative // Native PHP session management
- Core\\Session\\SessionArray // Store in array, not persistent, for testing
- Core\\Session\\SessionCache // Store in cache, not persistent, for testing

of course, you can write own adapter to store session in memcache or Redis etc.

How it use?

```
use Core\Session\SessionNative;

    $session = new Core\Session\SessionNative();

    // start the session
    $session->start();

    // Set param one with value test1
    $session->set('one', 'test1');

    // get param one or null if not exists
    $session->get('one');

    // get param one or default value if not exists
    $session->get('one','default value');

    // Return bool if param exists or not
    $session->has('one');

    // Delete the param
    $session->delete('one');

    // Return bool if session started or not
    $session->isStarted();

    // Clear session
    $session->clear()

    // Destroy the session
    $session->destroy();
```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity57

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

5

Last Release

1084d ago

### Community

Maintainers

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

---

Top Contributors

[![rnr1721](https://avatars.githubusercontent.com/u/122087344?v=4)](https://github.com/rnr1721 "rnr1721 (1 commits)")

---

Tags

frameworksessioncookiecomponentle7le7-framework

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/rnr1721-le7-cookie-wrapper/health.svg)

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

PHPackages © 2026

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