PHPackages                             moviet/session-scary - 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. moviet/session-scary

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

moviet/session-scary
====================

A simple session organizer library for php

1.0(7y ago)0111MITPHPPHP &gt;=7.0

Since Dec 11Pushed 7y agoCompare

[ Source](https://github.com/moviet/session-scary)[ Packagist](https://packagist.org/packages/moviet/session-scary)[ Docs](https://github.com/moviet/session-scary)[ RSS](/packages/moviet-session-scary/feed)WikiDiscussions master Synced yesterday

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

Scary - A simple session organizer for php
==========================================

[](#scary---a-simple-session-organizer-for-php)

[![Build Status](https://camo.githubusercontent.com/686bec5fdb11be6bc2d05199a2d115370b5b5dfed5a2d8e0a91f2c7ead69f2fd/68747470733a2f2f7472617669732d63692e6f72672f6d6f766965742f7068702d656e6372797074696f6e2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/moviet/php-encryption)[![License](https://camo.githubusercontent.com/1e1cb7bae9fc55a01fc5443d26e358dc21c129253bcfa9841db85c4f25aa2ecf/687474703a2f2f696d672e736869656c64732e696f2f3a6c6963656e73652d6d69742d626c75652e7376673f7374796c653d666c61742d737175617265)](http://doge.mit-license.org)[![Usage](https://camo.githubusercontent.com/0b08974388db1eb1c4bdd7154a157aeb6ee7ba89469165e7752420415ab89270/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f75736167652d656173792d6666363962342e737667)](https://github.com/moviet/php-encryption)[![codecov](https://camo.githubusercontent.com/79ddc9b8e275f2e389023fd522d67ec5845fc0b270d899ba29935768337d2099/68747470733a2f2f636f6465636f762e696f2f67682f6d6f766965742f73657373696f6e2d73636172792f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/moviet/session-scary)[![Codacy Badge](https://camo.githubusercontent.com/685bb0be5fe974c68cb3fd45172988dca92d3e91da12060cd76ac6607ea944d4/68747470733a2f2f6170692e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f6665363431356638383034393438383062363963663537346439323438663964)](https://www.codacy.com/app/moviet/session-scary?utm_source=github.com&utm_medium=referral&utm_content=moviet/session-scary&utm_campaign=Badge_Grade)

A very simple session organizer that may help you for handling scary styles on php

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

[](#requirements)

- Composer for installation

Quick Start
-----------

[](#quick-start)

#### Installation

[](#installation)

```
composer require "moviet/session-scary"

```

Release
-------

[](#release)

The current released is only support for handling happy *global procedural* session

Features
--------

[](#features)

- Create Single Session
- Generate Multiple Session
- Evaluate Session
- Make Auto Increment
- Custom Session Expiration
- Regenerate Session Id
- Remove Session

Usage
-----

[](#usage)

### Create A Single Session

[](#create-a-single-session)

- You can follow the humble style like below

    ```
    Scary::set('my_token')->value('11001101')->get();
    ```

    the above will equivalent

    ```
    $_SESSION['my_token'] = '11001101'
    ```
- Then to get a single session

    ```
    Scary::read('my_token'); // output => 11001101
    ```

    **Notes** :

    > When you refresh the browser the values will be **save** in session at first, you may need (eg. token, random, url)
    > and don't want to lost when the page's refresh, just like common it may useful

### Generate Multiple Session

[](#generate-multiple-session)

- You can fashion a session banks on easy away

    ```
    Scary::mset('My Session Manager')
       ->mkey(['Specialist','Senior','Junior'])
       ->mval(['value_1','value_2','value_3'])
       ->swap();
    ```
- Or you may relax with a free style

    ```
    $keys = ['Specialist','Senior','Junior'];
    $values = ['Baz','Biz','Buz'];

    Scary::mset('My Session Manager')
       ->mkey($keys)
       ->mval($values)
       ->swap();
    ```
- And then to express your tailor

    ```
    Scary::read('My Session Manager','Junior'); // output => Buz
    ```

    **Notes** :

    > When you refresh the browser the values will be **save** in session at first, you may need (eg. token, random, url)
    > and don't want to lost when the page's refresh, just like common it may useful

### Evaluate A Session

[](#evaluate-a-session)

- For *single session*, you can replace with new something

    ```
    Scary::change('Angry Boss','Run'); // replace other value eg. Run
    ```
- And for *multiple sets*, you can replace like this

    ```
    Scary::mchange('My Bread','My Chocolato','Eat Me');
    ```

    Now that was going through changes and you can dump with yayy...

### Make Auto Increment

[](#make-auto-increment)

- For example you may want to make eg. *login attempt* using a single method

    ```
    Scary::set('my_key')->value('11001101')->inc(5)->get();
    ```
- Or using multiple series

    ```
    Scary::mset('My Desire Key')
       ->mkey(['Eat','Drink','Lick','Whatever..'])
       ->mval(['Apple','Orange','Lollipop','Hufft..'])
       ->inc(5) // swap();
    ```

    On above example you will get an auto-increment max. **5 times**, start from 0-5
- If you want to verify eg. *session loggedin*, you can write like

    ```
    if (Scary::flinc('My Desire Key') !== true)

    // Do something
    ```

    **Notes** :

    > It will return **false** when session doesn't exists, then you can do something

### Custom Session Expiration

[](#custom-session-expiration)

- You can recruit a custom flash message, expirated or any creations

    ```
    Scary::set('my_key')->value('11001101')->ttl(5)->get();
    ```
- Using multiple happy set

    ```
    Scary::mset('My Desire Key')
       ->mkey(['Smile','Happy','Affraid'])
       ->mval(['Lost','Donate','Any Expression Here'])
       ->swap();

    Scary::live('My Desire Key', 5) // it can be place in somewhere pages, if return false, you can do something
    ```

    **Notes** :

    > use ***ttl or live*** like examples on above meant the session will expired within **5 minutes**

### Regenerate Session Id

[](#regenerate-session-id)

- You may doubt with an existing session, you can ensure with this

    ```
    if (Scary::exist('my_session_key'))

    // Do something
    ```
- To regenerate session with create **new id** you can draw this

    ```
    Scary::newId('my_session_key');
    ```
- Or using this to **refresh** session\_id

    ```
    Scary::refresh('my_session_key'); // session_regenerate_id(true)
    ```

### Remove Session

[](#remove-session)

- To **remove** a single session with work like charm

    ```
    Scary::trash('my_session_key');
    ```
- And **remove** multiple session at once

    ```
    Scary::trash('chocomelo, durian, alphanut, loggadin, url, token, and...');
    ```
- Also you can **destroy** all session and make them gone

    ```
    Scary::clean('my_session_key');
    ```

Example
-------

[](#example)

#### Create A Single Session

[](#create-a-single-session-1)

```
require '__DIR__' . '/vendor/autoload.php';

use Moviet\Session\Scary;

// Generate Cross Smile Request Poorgery
$randomToken = base64_encode(random_bytes(32));

Scary::set('Emo Cry Attack')->value($randomToken)->get();

$check = Scary::read('Emo Cry Attack');

// dump : JHs+jsakjkja87823hsalwatah989jsajh+sakCacanana83729Mama=
```

#### Create Multiple Session

[](#create-multiple-session)

```
require '__DIR__' . '/vendor/autoload.php';

use Moviet\Session\Scary;

// Type whatever collection
$verify = 'true';

// Register what you need
$loggadId = '2928929-988787-8877-78688868';

// Type secret code etc
$randomMult = bin2hex(random_bytes(16));

// Type like Adurl
$downloadUrl = 'github.com/moviet/session-scary';

/**
* Compile them in single bandage
*/
Scary::mset('Something key')
      ->mkey(['verify','token_key','mis-loggadin','download-url'])
      ->mval([$verify, $randomMult, $loggadId, $downloadUrl])
      ->swap();

$getClone = Scary::read('Something key','download-url');

// dump yaaaayyy : github.com/moviet/session-scary
```

License
-------

[](#license)

`Moviet/session-scary` is released under the MIT public license. See LICENSE for details

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity56

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

2709d ago

### Community

Maintainers

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

---

Top Contributors

[![moviet](https://avatars.githubusercontent.com/u/45540985?v=4)](https://github.com/moviet "moviet (40 commits)")

---

Tags

session-handlersession-managersession-organizersession-wrappersessionssimple-sessiontokenwrapperSimplehandlersessionphp sessionglobalOrganizer

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/moviet-session-scary/health.svg)

```
[![Health](https://phpackages.com/badges/moviet-session-scary/health.svg)](https://phpackages.com/packages/moviet-session-scary)
```

###  Alternatives

[simplesoftwareio/simple-qrcode

Simple QrCode is a QR code generator made for Laravel.

2.9k27.6M92](/packages/simplesoftwareio-simple-qrcode)[kevinsimard/laravel-cookieless-session

Laravel middleware to start a cookieless session

1417.0k](/packages/kevinsimard-laravel-cookieless-session)

PHPackages © 2026

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