This package is abandoned and no longer maintained. No replacement package was suggested.

PHP session made easy with Packfire Session library.

1.2.0 2014-02-06 15:11 UTC

This package is not auto-updated.

Last update: 2021-05-23 22:44:58 UTC


#Packfire Session

PHP session made easy with Packfire Session library.

Packfire Session aims to abstract and improve the behaviour of PHP Session for out-of-the-box usage with improved security.

##Installation Use Composer to include Packfire Session in your project.

    "require": {
		"packfire/session": "1.0.*"

Run Composer to install Packfire Session for use with your project.

$ composer install


The Session class is the main class we can work the session from.

To initiate a session:

use Packfire\Session\Session;
use Packfire\Session\Storage\SessionStorage;

$session = new Session(new SessionStorage());
if (!Session::detectCookie()) { // only register session if cookie is not found.
	Session::register(); // session_start();

To regenerate a new Session ID (recommended when users sign in / out to improve security):


Invalidate a session (session is kept registered, but all values are cleared, session ID is regenerated):


Destroy a session (session ID is removed entirely):


Session Buckets are great way to scope down your session variables. To get started working with session buckets:

$bucket = $session->bucket('form');
$bucket->set('txtName', $_POST['txtName']);