fatkulnurk/session

There is no license information available for the latest version (v1.0.0) of this package.

PHP library for handling sessions

v1.0.0 2020-03-26 19:49 UTC

This package is auto-updated.

Last update: 2024-04-27 05:01:24 UTC


README

PHP library for handling sessions

Install

See in packagist

https://packagist.org/packages/fatkulnurk/session

with composer

composer require fatkulnurk/session

Under Development

  • Get session with nested key
  • Set session with Nested Value

Usage

Start session:

Session::init();

Start session by setting the session duration:

Param in seconds.

Session::init(3600);

Add value to a session:

Session::set('name', 'Fatkul Nur Koirudin');

Add multiple value to sessions:

Unsupport for nested array.

$data = [
    'name'     => 'Rudi',
    'gender'   => 'Male',
];

Session::set($data);

Extract session item, delete session item and finally return the item:

Session::pull('name');

Return the session array / Return all session value:

Session::get();

Get session id:

Session::id();

Destroys one key session:

Session::destroy('name');

Destroys all sessions:

Session::destroy();