PHPackages                             tui/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. [Validation &amp; Sanitization](/categories/validation)
4. /
5. tui/session-bundle

AbandonedArchivedSymfony-bundle[Validation &amp; Sanitization](/categories/validation)

tui/session-bundle
==================

Adds a session expiry listener

1.1.1(13y ago)32.3k2MITPHP

Since Apr 14Pushed 12y ago10 watchersCompare

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

READMEChangelogDependenciesVersions (7)Used By (0)

Tui SessionBundle
=================

[](#tui-sessionbundle)

Adds a listener that expires user sessions after a configurable period of inactivity.

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

[](#installation)

Add this require reference to your `composer.json`:

```
php composer.phar require tui/session-bundle:~1.1
```

Add the Bundle to your `app/AppKernel.php`:

```
public function registerBundles()
{
    $bundles = array(
        // …
        new Tui/SessionBundle/TuiSessionBundle(),
    }
    // …
```

You can configure the timeout in your `app.yml` file:

```
tui_session:
    session_timeout: 3600 # One hour
```

Redirecting on expiry
---------------------

[](#redirecting-on-expiry)

By default when the session expires, the listener will invalidate the session and throw a CredentialsExpired exception. Obviously it'd be much better to redirect the user to a "Login expired" page. There are two ways you can do that:

### Redirect to a route

[](#redirect-to-a-route)

The listener can redirect to a given route when the session expires. This is super easy, but not very flexible. In your `app.yml` file:

```
tui_session:
    redirect_route: login_expired
```

### Return a custom response

[](#return-a-custom-response)

Alternatively you can create a custom response, register it as a service and configure it to be returned instead. Here's a trivial example that uses the built-in response class.

```
tui_session:
    expired_response: session_expired

services:
    session_expired:
        class: Symfony\Component\HttpFoundation\Response
        arguments:
            - 'Your login expired, sorry!'
```

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~1 days

Total

5

Last Release

4767d ago

### Community

Maintainers

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

---

Top Contributors

[![mattattui](https://avatars.githubusercontent.com/u/93214?v=4)](https://github.com/mattattui "mattattui (13 commits)")

---

Tags

symfonysession

### Embed Badge

![Health badge](/badges/tui-session-bundle/health.svg)

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

###  Alternatives

[rollerworks/password-strength-validator

Password-strength validator for Symfony

1455.7M5](/packages/rollerworks-password-strength-validator)[apy/jsfv-bundle

Symfony2 Javascript Form Validation Bundle with localisation support

92770.5k](/packages/apy-jsfv-bundle)[isometriks/spam-bundle

Provides spam protection for Symfony forms

46200.6k1](/packages/isometriks-spam-bundle)[fab2s/dt0

Immutable DTOs with bidirectional casting. No framework required. 8x faster than the alternative.

101.6k1](/packages/fab2s-dt0)

PHPackages © 2026

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