tobias/zend-expressive-session-zf1

ext-session persistence adapter for zend-expressive-session and compatible to ZF1

0.1.0 2018-11-22 07:59 UTC

This package is auto-updated.

Last update: 2024-10-22 21:00:00 UTC


README

Build status Coverage Status

Zend Expressive ZF1 Compatible Session

Provides an ZF1 compatible ext-session persistence adapter for use with zend-expressive-session.

Inspired and based on zend-expressive-session-ext.

Installation

Run the following to install this library::

$ composer require tobias/zend-expressive-session-zf1

Configuration

If your application uses the zend-component-installer Composer plugin, your configuration is complete; the shipped Tobias\Zend\Expressive\Zf1Session\ConfigProvider registers the Tobias\Zend\Expressive\Zf1Session\Persistence\SessionPersistence service, as well as an alias to SessionPersistence it under the name Zend\Expressive\Session\SessionPersistenceInterface.

You can add the Tobias\Zend\Expressive\Zf1Session\ConfigProvider manually to your config/config.php e.g.:

$aggregator = new ConfigAggregator(
    [
        // ...
        
        \Zend\Expressive\Session\ConfigProvider::class,
        \Tobias\Zend\Expressive\Zf1Session\ConfigProvider::class,

        // ...
    ]);

Otherwise, you will need to map Zend\Expressive\Session\SessionPersistenceInterface to Tobias\Zend\Expressive\Zf1Session\Persistence\SessionPersistence in your dependency injection container.

In addition to this you can configure all parameters passed to the session via configuration, e.g. config/autoload/session-params.global.php

<?php
return [
    'session' => [
        'use_cookies' => false,
        'use_only_cookies' => true,
    ]
];