PHPackages                             blast-project/doctrine-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. [Database &amp; ORM](/categories/database)
4. /
5. blast-project/doctrine-session-bundle

ActiveSymfony-bundle[Database &amp; ORM](/categories/database)

blast-project/doctrine-session-bundle
=====================================

Store your Symfony sessions in database through doctrine

0.6.4(8y ago)12.0k11LGPL-3.0PHPPHP &gt;=7.1

Since Feb 16Pushed 8y ago3 watchersCompare

[ Source](https://github.com/blast-project/DoctrineSessionBundle)[ Packagist](https://packagist.org/packages/blast-project/doctrine-session-bundle)[ Docs](https://github.com/blast-project/BaseEntitiesBundle)[ RSS](/packages/blast-project-doctrine-session-bundle/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (8)Versions (13)Used By (1)

Blast DoctrineSessionBundle
===========================

[](#blast-doctrinesessionbundle)

[![Build Status](https://camo.githubusercontent.com/fdc68eb4747f517d36d37fff3016898f63415d95a98cfcf5cdee9b7ef081dff5/68747470733a2f2f7472617669732d63692e6f72672f626c6173742d70726f6a6563742f446f637472696e6553657373696f6e42756e646c652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/blast-project/DoctrineSessionBundle)[![Coverage Status](https://camo.githubusercontent.com/4b9716e6c58adb829efa37fa1b446ed37c52436eb69f0fd49f1bd56d8e5829bf/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f626c6173742d70726f6a6563742f446f637472696e6553657373696f6e42756e646c652f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/blast-project/DoctrineSessionBundle?branch=master)[![License](https://camo.githubusercontent.com/2a073a8452bd684d650088b360e223c4fa9416078f98b452b4c70517cdc1d9fc/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f626c6173742d70726f6a6563742f446f637472696e6553657373696f6e42756e646c652e7376673f7374796c653d666c61742d737175617265)](./LICENCE.md)

[![Latest Stable Version](https://camo.githubusercontent.com/1854fe5c8c8406e5b414534cc15d3012f27d1e023d0981b99ba8cd4f2fa5e887/68747470733a2f2f706f7365722e707567782e6f72672f626c6173742d70726f6a6563742f646f637472696e652d73657373696f6e2d62756e646c652f762f737461626c65)](https://packagist.org/packages/blast-project/doctrine-session-bundle)[![Latest Unstable Version](https://camo.githubusercontent.com/aabaf8d2b01477e5772911b12eec6911c7218b0a4047671ba636daf916f52b46/68747470733a2f2f706f7365722e707567782e6f72672f626c6173742d70726f6a6563742f646f637472696e652d73657373696f6e2d62756e646c652f762f756e737461626c65)](https://packagist.org/packages/blast-project/doctrine-session-bundle)[![Total Downloads](https://camo.githubusercontent.com/3c1df3449c3f011cb6af0a6fc9763fe7c36413c231c9f138c066e59269421924/68747470733a2f2f706f7365722e707567782e6f72672f626c6173742d70726f6a6563742f646f637472696e652d73657373696f6e2d62756e646c652f646f776e6c6f616473)](https://packagist.org/packages/blast-project/doctrine-session-bundle)

The goal of this bundle is to make the use of Doctrine as session handler for Symfony

Installation
============

[](#installation)

Downloading
-----------

[](#downloading)

$ composer require blast-project/doctrine-session-bundle

Add to your AppKernel
---------------------

[](#add-to-your-appkernel)

```
//...

class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = [
            //...

            new Blast\DoctrineSessionBundle\BlastDoctrineSessionBundle(),

        ];
        //...
    }
    //...
}
```

Doctrine
--------

[](#doctrine)

Configure your Doctrine connections

```
# app/config/config.yml

doctrine:
    dbal:
        default_connection: default
        connections:
            default:
                driver:   pdo_pgsql
                host:     "%database_host%"
                port:     "%database_port%"
                dbname:   "%database_name%"
                user:     "%database_user%"
                password: "%database_password%"
                charset:  UTF8
            session: # This will be the connection used by this bundle
                driver:   pdo_pgsql
                host:     "%database_host%" # Please adapt to your needs if you're using another database for sessions
                port:     "%database_port%"
                dbname:   "%database_name%"
                user:     "%database_user%"
                password: "%database_password%"
                charset:  UTF8

    orm:
        default_entity_manager: default
        auto_generate_proxy_classes: "%kernel.debug%"
        entity_managers:
            default:
                connection: default
                naming_strategy: doctrine.orm.naming_strategy.underscore
                auto_mapping: true
                mappings:
                    # Add here your mapping for your default entities
                    # Example below :
                    BlastBaseEntitiesBundle:
                        type: yml
            session:
                connection: session
                naming_strategy: doctrine.orm.naming_strategy.underscore
                auto_mapping: false # Only one entity manager can have auto_mappping set to true
                mappings:
                    BlastDoctrineSessionBundle:
                        type: yml
```

Configure the framework session handler :

```
# app/config/config.yml

framework:
    # [...]
    session:
        handler_id: blast_doctrine_handler
```

Database
--------

[](#database)

$ php bin/console doctrine:database:create --connection=session

Or

$ php bin/console doctrine:schema:update --force --connection=session

Usage
-----

[](#usage)

```
use Blast\DoctrineSessionBundle\Handler\DoctrineORMHandler;
use Symfony\Component\HttpFoundation\Session\Session;
use Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage;

//...

        $doctrinehandler = new DoctrineORMHandler(
                         $this->get('doctrine'),
                         'Blast\DoctrineSessionBundle\Entity\Session');

        $storage = new NativeSessionStorage(
                 array(),
                 $doctrinehandler
        );

        $session = new Session($storage);
        $session->start();
//...
```

See
---

[](#see)

[http://symfony.com/doc/current/components/http\_foundation/session\_configuration.html](http://symfony.com/doc/current/components/http_foundation/session_configuration.html)

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 78.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~28 days

Total

10

Last Release

3161d ago

PHP version history (4 changes)0.1PHP ~5.5|~7.0

0.3PHP ~5.6|~7.0

0.4.2PHP &gt;=5.6

0.6.4PHP &gt;=7.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/0bbce846c0d9bbaf3fc4f62538f638bb1f093d651e1bca9c0c6e0d97645286f8?d=identicon)[beta](/maintainers/beta)

![](https://avatars.githubusercontent.com/u/16222295?v=4)[Marcos Bezerra de Menezes](/maintainers/marcoslibre)[@marcoslibre](https://github.com/marcoslibre)

![](https://www.gravatar.com/avatar/928e77bd50201c2a30df571e6ff90c01a8cdfe29eec21f57fb7c143ba7c1a35e?d=identicon)[RomainSanchez](/maintainers/RomainSanchez)

![](https://www.gravatar.com/avatar/fc3ab5e7bcedd6769ea7ea27b9b65157b62b4b127296dd6762388d400193b054?d=identicon)[BlastCI](/maintainers/BlastCI)

---

Top Contributors

[![FanchTheSystem](https://avatars.githubusercontent.com/u/882203?v=4)](https://github.com/FanchTheSystem "FanchTheSystem (11 commits)")[![RomainSanchez](https://avatars.githubusercontent.com/u/18164227?v=4)](https://github.com/RomainSanchez "RomainSanchez (2 commits)")[![PapsOu](https://avatars.githubusercontent.com/u/5792207?v=4)](https://github.com/PapsOu "PapsOu (1 commits)")

---

Tags

blastdoctrinesessionsymfonysymfonydoctrineblast

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/blast-project-doctrine-session-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/blast-project-doctrine-session-bundle/health.svg)](https://phpackages.com/packages/blast-project-doctrine-session-bundle)
```

###  Alternatives

[rcsofttech/audit-trail-bundle

Enterprise-grade, high-performance Symfony audit trail bundle. Automatically track Doctrine entity changes with split-phase architecture, multiple transports (HTTP, Queue, Doctrine), and sensitive data masking.

1175.2k](/packages/rcsofttech-audit-trail-bundle)[ahmed-bhs/doctrine-doctor

Runtime analysis tool for Doctrine ORM integrated into Symfony Web Profiler. Unlike static linters, it analyzes actual query execution at runtime to detect performance bottlenecks, security vulnerabilities, and best practice violations during development with real execution context and data.

939.0k](/packages/ahmed-bhs-doctrine-doctor)[doctrineencryptbundle/doctrine-encrypt-bundle

Encrypted symfony entity's by verified and standardized libraries

32477.7k](/packages/doctrineencryptbundle-doctrine-encrypt-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
