Skip to content

phpmentors-jp/route-based-session-configuration-bundle

Repository files navigation

RouteBasedSessionConfigurationBundle

A Symfony bundle for session configuration based on route configuration

Total Downloads Latest Stable Version Latest Unstable Version Build Status

Features

  • Runtime session configuration by route configuration

Installation

RouteBasedSessionConfigurationBundle can be installed using Composer.

First, add the dependency to phpmentors/route-based-session-configuration-bundle into your composer.json file as the following:

Stable version:

composer require phpmentors/route-based-session-configuration-bundle "1.1.*"

Development version:

composer require phpmentors/route-based-session-configuration-bundle "~1.2@dev"

Second, add PHPMentorsRouteBasedSessionConfigurationBundle into your bundles to register in AppKernel::registerBundles() as the following:

...
class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            ...
            new PHPMentors\RouteBasedSessionConfigurationBundle\PHPMentorsRouteBasedSessionConfigurationBundle(),
        );
        ...

Configuration

# app/config/routing.yml
# ...
customer:
    # set session.* ini variables without leading "session."
    # see "Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage::setOptions()" for available options
    options:
        session:
            name: CUSTOMER_SESSION
            # ...

Support

If you find a bug or have a question, or want to request a feature, create an issue or pull request for it on Issues.

Copyright

Copyright (c) 2016-2017, 2019 KUBO Atsuhiro, All rights reserved.

License

The BSD 2-Clause License