2017 © Pedro Peláez
 

library chubbyphp-session

Chubbyphp Session

image

chubbyphp/chubbyphp-session

Chubbyphp Session

  • Friday, April 20, 2018
  • by dominikzogg
  • Repository
  • 0 Watchers
  • 0 Stars
  • 430 Installations
  • PHP
  • 3 Dependents
  • 1 Suggesters
  • 0 Forks
  • 0 Open issues
  • 8 Versions
  • 0 % Grown

The README.md

chubbyphp-session

Build Status Scrutinizer Code Quality Code Coverage Total Downloads Monthly Downloads Latest Stable Version Latest Unstable Version, (*1)

Description

A simple session solution, based on the [PSR7Session][2] (client side session)., (*2)

Requirements

  • php: ~7.0
  • psr7-sessions/storageless: ~3.0

Suggest

  • pimple/pimple: ~3.0

Installation

Through Composer as chubbyphp/chubbyphp-session., (*3)

composer require chubbyphp/chubbyphp-session "~1.1"

Usage

Session

<?php

use Chubbyphp\Session\FlashMessage;
use Chubbyphp\Session\Session;
use Psr\Http\Message\ServerRequestInterface as Request;

$session = new Session();

// check for existing key
$session->has($request, 'some.key');

// get value for existing key
$session->get($request, 'some.key', null);

// set value for key
$session->set($request, 'some.key', 'some.value');

// remove existing key
$session->remove($request, 'some.key');

// add flash message
$session->addFlash($request, new FlashMessage(FlashMessage::TYPE_SUCCESS, 'successfully saved'));

// get flash message
$flashMessage = $session->getFlash($request); // removes the flash from session

SessionMiddleware

<?php

$app = ...

// sample for slim
$app->add($container['session.middleware']);

SessionProvider (Pimple)

<?php

use Chubbyphp\Session\Session;
use Chubbyphp\Session\SessionProvider;
use Pimple\Container;

$container->register(new SessionProvider);

// replaceable configuration (set before first middleware use)
$container['session.expirationTime'] = 1200;
$container['session.privateRsaKey'] = '';
$container['session.publicRsaKey'] = '';

$container['session.setCookieHttpOnly'] = true;
$container['session.setCookiePath'] = '/';
$container['session.setCookieSecureOnly'] = true;

/** @var Session $session */
$session = $container['session'];

Dominik Zogg 2016, (*4)

The Versions

20/04 2018

dev-master

9999999-dev

Chubbyphp Session

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dominik Zogg

slim session chubbyphp

20/04 2018

1.0.3

1.0.3.0

Chubbyphp Session

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dominik Zogg

slim session chubbyphp

05/05 2017

1.0.2

1.0.2.0

Chubbyphp Session

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dominik Zogg

slim session chubbyphp

26/04 2017

1.0.1

1.0.1.0

Chubbyphp Session

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dominik Zogg

slim session chubbyphp

13/10 2016

1.0.0

1.0.0.0

Chubbyphp Session

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dominik Zogg

slim session chubbyphp

13/10 2016

1.0.0-beta2

1.0.0.0-beta2

Chubbyphp Session

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dominik Zogg

slim session chubbyphp

13/10 2016

1.0.0-beta1

1.0.0.0-beta1

Chubbyphp Session

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dominik Zogg

slim session chubbyphp

03/10 2016

1.0.0-alpha1

1.0.0.0-alpha1

Chubbyphp Session

  Sources   Download

MIT

The Requires

 

The Development Requires

by Dominik Zogg

slim session chubbyphp