PHPackages                             sgrodzicki/hack-session-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. sgrodzicki/hack-session-bundle

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

sgrodzicki/hack-session-bundle
==============================

Hack to allow having the session allowed starting when login\_check

066.2kPHP

Since Feb 7Pushed 13y ago1 watchersCompare

[ Source](https://github.com/sgrodzicki/HackSessionBundle)[ Packagist](https://packagist.org/packages/sgrodzicki/hack-session-bundle)[ RSS](/packages/sgrodzicki-hack-session-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Hack bundle for session beginning one click too early on login
==============================================================

[](#hack-bundle-for-session-beginning-one-click-too-early-on-login)

Purpose
-------

[](#purpose)

Because for a customer project we have a login form on every page and high trafic, we want to begin the session very late. The goal is to get all the benefits of Varnish by caring very low on the cache policy at the VCL config level but more at the HTTP classical level.

The current issue points to this question : [symfony/symfony#3703](https://github.com/symfony/symfony/issues/3703)

Assumption
----------

[](#assumption)

This assumption used for this temporary fix is really precise but allows only one 'login\_check' route (for one firewall so)

To begin
--------

[](#to-begin)

First, the auto\_start session parameter must be disabled like this:

```
# app/config/config.yml
...
framework:
    ...
    session:
        auto_start:     false

```

Installation
------------

[](#installation)

Add the bundle in the deps file of your project:

```
# deps
[HackSessionBundle]
    git=git@github.com:gillest/HackSessionBundle.git
    target=bundles/Gilles/Bundle/HackSessionBundle

```

Launch the bundle install command then:

```
./bin/vendors install

```

Add the bundle namespace to the autoload configuration file.

```
# app/autoload.php
