renegare / silexcsh
Cookie Session Handler for Silex (store session data client side)
Installs: 640
Dependents: 1
Suggesters: 0
Security: 0
Stars: 1
Watchers: 0
Forks: 1
pkg:composer/renegare/silexcsh
Requires
- php: >=5.4.0
- psr/log: 1.0.0
Requires (Dev)
- phpunit/phpunit: 3.7.*
- silex/silex: >=1.0
- symfony/browser-kit: >=2.3,<2.6-dev
- symfony/http-foundation: >=2.4,<2.6-dev
This package is not auto-updated.
Last update: 2025-10-21 08:13:33 UTC
README
Silex Cookie Session Handler
Requirements
- PHP 5.4
- composer (preferably latest)
Installation
$ composer require renegare/silexcsh:dev-master
Usage Examples:
Silex Usage
<?php
$app = new Silex\Application();
$app->register(new Renegare\SilexCSH\CookieSessionServiceProvider, [
    'session.cookie.options' => [
        'name' => 'CUSTOMNAME', // string
        'lifetime' => 0,        // int
        'path' => '/',          // string
        'domain' => null,       // string
        'secure' => false,      // boolean
        'httponly' => true      // boolean
    ]
]);
$app->get('/doing-nothing', function(Application $app) {
    return 'Nothing going on here with sessions';
});
$app->get('/persist', function(Application $app){
    $app['session']->set('message', 'Hello There!');
    return 'Check your cookie!';
});
$app->get('/read', function(Application $app){
    return print_r($app['session']->all(), true);
});
$app->get('/destroy', function(Application $app) {
    $app['session']->clear();
    return 'Ok Bye Bye!';
});
Test
Check out the repo and from the top level directory run the following command (xdebug required for coverage):
$ composer update && vendor/bin/phpunit --coverage-text
Credits
Inspired by: nelmio/NelmioSecurityBundle