A Symfony bundle for session configuration based on route configuration
- Runtime session configuration by route configuration
PHPMentorsRouteBasedSessionConfigurationBundle 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.0.*"
Development version:
composer require phpmentors/route-based-session-configuration-bundle "~1.1@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(),
);
...# 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
# ...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 (c) 2016-2017 KUBO Atsuhiro, All rights reserved.