2017 © Pedro Peláez
 

library cookiesession

Very light library to manage easily and simply the Session and Cookie with PHP 7+

image

ph-7/cookiesession

Very light library to manage easily and simply the Session and Cookie with PHP 7+

  • Monday, July 3, 2017
  • by ph-7
  • Repository
  • 3 Watchers
  • 4 Stars
  • 22 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 7 Versions
  • 0 % Grown

The README.md

CookieSession

CookieSession is a very light library to manage easily and simply the Session and Cookie with PHP 7+ (and without spending time by configuring and securing them)., (*1)

Composer Installation

You can add it easily in your projec by using Composer., (*2)

$ composer require ph-7/cookiesession
 ```

Then, include Composer's autoload

```PHP
require_once 'vendor/autoload.php';

Manual Installation

If you don't use Composer, you can install it without Composer by including the following, (*3)

require 'src/autoloader.php';

Usage for Session

<?php
use PH7\CookieSession\Session\Session;

$oSession = new Session;

$oSession->set('lang_pref', 'English');

// Create some sessions with an array
$aData = [
    'my_session' => 'The value',
    'another_session' => 'Another value',
    'my_name' => 'Pierre-Henry'
];
// Add these sessions
$oSession->set($aData);


// Get session
echo $oSession->get('lang_pref'); // Will display 'English'
echo $oSession->get('another_session'); // Will display 'Another value'

echo ($oSession->exists('my_name')) ? $oSession->get('my_name') : 'Well, well, we dont have a name in the session'; // Will display 'Pierre-Henry'

$oSession->remove('my_name'); // Remove 'my_name' session

echo $oSession->get('my_name'); // Will display nothing (empty string) as 'my_name' session has been removed
<?php
use PH7\CookieSession\Cookie\Cookie;

$oCookie = new Cookie;

$oCookie->set('mycookie', 'Amazing Value!');

// Create some cookies in array
$aCookies = [
    'name' => 'Pierre-Henry',
    'city' => 'Manchester',
    'job' => 'Software Engineer'
];
$oCookie->set($aCookies);

if ($oCookie->exists($aCookies)) {
    echo 'All the following cookies exist: ' . implode(', ', $aCookies);
}

echo $oCookie->get('name'); // Will display 'Pierre-Henry'
echo $oCookie->get('mycookie'); // Will display 'Amazing Value!'

$oCookie->remove($aCookies); // Remove all cookies

echo $oCookie->get('name');  // Will display nothing (empty string)

Requirements

  • PHP 7 or higher

The Author

I'm Pierre-Henry Soria, Software Developer passionate about a lot of things and currently living in Manchester city, UK, (*4)

Contact

You can send an email at pierrehenrysoria [AT] gmail {D0T} COM or at phy {AT} hizup [D0T] UK, (*5)

License

Under General Public License 3 or later., (*6)

The Versions

03/07 2017

dev-master

9999999-dev http://ph7cms.com

Very light library to manage easily and simply the Session and Cookie with PHP 7+

  Sources   Download

GPL-3.0+

The Requires

  • php >=7.0.0

 

cookie session secure php 7 secure session secure cookie cookie session

03/07 2017

1.0.9

1.0.9.0 http://ph7cms.com

Very light library to manage easily and simply the Session and Cookie with PHP 7+

  Sources   Download

GPL-3.0+

The Requires

  • php >=7.0.0

 

cookie session secure php 7 secure session secure cookie cookie session

02/07 2016

1.0.8

1.0.8.0 http://ph7cms.com

Very light library to manage easily and simply the Session and Cookie with PHP 7+

  Sources   Download

GPL-3.0+

The Requires

  • php >=7.0.0

 

cookie session secure php 7 secure session secure cookie cookie session

08/03 2016

1.0.7

1.0.7.0 http://ph7cms.com

Very light library to manage easily and simply the Session and Cookie with PHP 7+

  Sources   Download

GPL-3.0+

The Requires

  • php >=7.0.0

 

cookie session secure php 7 secure session secure cookie cookie session

08/03 2016

1.0.6

1.0.6.0 http://ph7cms.com

Very light library to manage easily and simply the Session and Cookie with PHP 7+

  Sources   Download

GPL-3.0+

The Requires

  • php >=7.0.0

 

cookie session secure php 7 secure session secure cookie cookie session

28/02 2016

1.0.5

1.0.5.0 http://ph7cms.com

Very light library to manage easily and simply the Session and Cookie with PHP 7+

  Sources   Download

GPL-3.0+

The Requires

  • php >=7.0.0

 

cookie session secure php 7 secure session secure cookie cookie session

28/02 2016

1.0.3

1.0.3.0 http://ph7cms.com

Very light library to manage easily and simply the Session and Cookie with PHP 7+

  Sources   Download

GPL-3.0+

The Requires

  • php >=7.0.0

 

cookie session secure php 7 secure session secure cookie cookie session