2017 © Pedro Peláez
 

library session-handler

Handle sessions in your application with this PHP library

image

internetpixels/session-handler

Handle sessions in your application with this PHP library

  • Saturday, December 23, 2017
  • by Petervw
  • Repository
  • 1 Watchers
  • 1 Stars
  • 3 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Session manager for PHP

Handle sessions in your application with this PHP library., (*1)

This is a open-source library. Please consider a link to this repository when you're actively using it., (*2)

License Build Status Maintainability, (*3)

Installation

Install this PHP session manager by using composer:, (*4)

composer require internetpixels/session-handler

Basic examples

Set a new session

In order to set a new session, you'll need to create a new session entity., (*5)

$manager = new SessionManager();
$testSession = new SessionEntity();
$testSession->setName( 'my_session' );
$testSession->setValue( 'Some value in the session' );

$manager->set( $testSession );

Validate a session

If you want to validate a session, simply call the exists method., (*6)

$manager = new SessionManager();
if( $manager->exists( 'my_session' ) ) {
    echo 'Exists!'; 
}
else {
    echo 'Create session..';    
}

Get a session

Getting the session as an object is even easier. Simply call the get method, with an optional default value., (*7)

$manager = new SessionManager();

/** @var SessionEntity $session */
$session = $manager->get( 'my_session' );

If you want to use a default value when the session is not available, you might want to use the default value., (*8)

$manager = new SessionManager();

/** @var SessionEntity $session */
$session = $manager->get( 'test_non_existing', 'my value' );

The Versions

23/12 2017

dev-master

9999999-dev

Handle sessions in your application with this PHP library

  Sources   Download

The Requires

  • php >=7.1

 

The Development Requires

by Peter van Wilderen

23/12 2017

1.0.0

1.0.0.0

Handle sessions in your application with this PHP library

  Sources   Download

The Requires

  • php >=7.1

 

The Development Requires

by Peter van Wilderen