PHPackages                             alfatraining/cassandra-session-handler-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. alfatraining/cassandra-session-handler-bundle

ActiveLibrary[Database &amp; ORM](/categories/database)

alfatraining/cassandra-session-handler-bundle
=============================================

Cassandra Session Handler Bundle for Symfony 4 &amp; 5.4

v2.0.4(3mo ago)037.6k↓17.8%1MITPHPPHP &gt;=8.0.2

Since Feb 19Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/rgsystemes/cassandra-session-handler-bundle)[ Packagist](https://packagist.org/packages/alfatraining/cassandra-session-handler-bundle)[ RSS](/packages/alfatraining-cassandra-session-handler-bundle/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (9)Dependencies (6)Versions (11)Used By (0)

Cassandra Session Handler bundle
================================

[](#cassandra-session-handler-bundle)

This Symfony 4 / 5.4 bundle provides a session handler for saving sessions in Cassandra.

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

[](#installation)

1. Add the repository and requirement to `composer.json`:

```
    {
        "repositories": [
            {
                "type": "vcs",
                "url": "git@github.com:alfatraining/cassandra-session-handler-bundle.git"
            }
        ],
        "require": {
            "alfatraining/cassandra-session-handler-bundle": "dev-master"
        }
    }
```

2. Install the bundle via `composer update` or `composer update nothing` if you don't want updates.
3. Register the bundle in `app/AppKernel.php`:

```
    new Alfatraining\CassandraSessionHandlerBundle\AlfatrainingCassandraSessionHandlerBundle(),
```

4. Add configuration parameters to your `app/config/config.yml` (the following shows the bundle defaults) and activate the session handler:

```
    framework:
        session:
            handler_id:  alfatraining_cassandra_session_handler.cassandra_session_handler

    alfatraining_cassandra_session_handler:
        keyspace:         symfony2_sessions    # Cassandra keyspace to use
        column_family:    sessions             # Cassandra table/column family to use
        session_lifetime: 84600                # session lifetime in seconds
```

5. Add parameters to `app/config/parameters.yml.dist` to configure the Cassandra cluster instance:

```
    parameters:
        # contact points can be 1) a single node (not advisable for Cassandra)
        cassandra_cluster.contact_points:       localhost
        # or 2) a comma-separated list of nodes (mixed host names / IP addresses possible)
        cassandra_cluster.contact_points:       localhost, 127.0.0.1, 172.18.1.10
        # or 3) a native YAML array
        cassandra_cluster.contact_points:
        - localhost
        - 127.0.0.1
        # of course, you may also write this using the inline style
        cassandra_cluster.contact_points:       [localhost, 127.0.0.1]

        # optionally set the credentials to be used for connecting to the Cassandra cluster
        cassandra_cluster.credentials.username: cassandra
        cassandra_cluster.credentials.password: cassandra
```

In Symfony 4, you can use an environnement variable which contains comma-separated values as a string :

```
# services.yaml
parameters:
    cassandra_cluster.contact_points: '%env(string:CASSANDRA_CLUSTER_HOSTS)%'
```

```
# .env.local
CASSANDRA_CLUSTER_HOSTS=10.0.0.1,10.0.0.2,10.0.0.3
```

Then run `composer install` again or update your `parameters.yml` by hand.

6. Don't forget to actually create the keyspace and the column family. An example of the CQL that's needed can be found in `Resources/doc/create_session_keyspace_and_table.sql` inside this bundle.

As you can see in the `Resources/config/services.yml` file you need to pass a `Cassandra\Cluster` (it's an interface even if it doesn't like one) instance to the session handler upon instantiation. Because the DefaultCluster has a lot of configuration options (for SSL, authentication and a whole lot more – see  for more information) you may replace this class entirely and just instantiate your own custom cluster class instance. Here's how:

1. Replace the class name to use in your `app/config/config.yml` file:

```
    parameters:
        cassandra_cluster.class: Namespace/To/Your/Own/Class
```

2. Take a look at how the bundle's implementation works in `Lib/Cassandra/Cluster.php`.

###  Health Score

53

—

FairBetter than 96% of packages

Maintenance81

Actively maintained with recent releases

Popularity29

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity72

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~324 days

Recently: every ~368 days

Total

9

Last Release

99d ago

Major Versions

v1.2.0 → v2.0.02022-03-14

PHP version history (3 changes)v1.0.0PHP &gt;=5.3.4

v2.0.0PHP &gt;=8.0.0

v2.0.4PHP &gt;=8.0.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/8c40b4517e75e83ed8fafd334ec08b2c864008dc3e3b5100e61d35001483b014?d=identicon)[rgsystemes](/maintainers/rgsystemes)

---

Top Contributors

[![sandvige](https://avatars.githubusercontent.com/u/1446309?v=4)](https://github.com/sandvige "sandvige (9 commits)")[![qkdreyer](https://avatars.githubusercontent.com/u/717869?v=4)](https://github.com/qkdreyer "qkdreyer (7 commits)")[![fidanf](https://avatars.githubusercontent.com/u/15977439?v=4)](https://github.com/fidanf "fidanf (4 commits)")[![Copilot](https://avatars.githubusercontent.com/in/1143301?v=4)](https://github.com/Copilot "Copilot (2 commits)")[![annismckenzie](https://avatars.githubusercontent.com/u/16936?v=4)](https://github.com/annismckenzie "annismckenzie (1 commits)")

---

Tags

symfonybundlesessioncassandradatastax

### Embed Badge

![Health badge](/badges/alfatraining-cassandra-session-handler-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/alfatraining-cassandra-session-handler-bundle/health.svg)](https://phpackages.com/packages/alfatraining-cassandra-session-handler-bundle)
```

###  Alternatives

[kimai/kimai

Kimai - Time Tracking

4.8k9.0k1](/packages/kimai-kimai)[web-auth/webauthn-framework

FIDO2/Webauthn library for PHP and Symfony Bundle.

515100.5k3](/packages/web-auth-webauthn-framework)[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.

1189.8k](/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.

9410.8k](/packages/ahmed-bhs-doctrine-doctor)

PHPackages © 2026

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