Get online users and set rules

v1.4.4 2017-07-25 22:55 UTC




SessionBundle Toolbar View

This bundle allows you to **obtain** all **users connected** to the system. In the same way it allows to define if the **multi-session** and the **multi-user** in the same is allowed.

Latest Stable Version Total Downloads Dependency Status Symfony License travis


Step 1: Download the Bundle

$ composer require kronhyx/session-bundle

This command requires that you have global composer installed, as explained in composer's documentation.

Step 2: Activate the Bundle

// app/AppKernel.php

// ...
class AppKernel extends Kernel
    public function registerBundles()
        $bundles = array(
            // ...
            new \Kronhyx\SessionBundle\KronhyxSessionBundle()

    // ...

Step 3: Load the bundle routes

# app/config/routing.yml
    resource: "@KronhyxSessionBundle/Resources/config/routing.yml"    
    prefix:   /
# ...

Step 4: Add the bundle configuration

# app/config/config.yml
    user_interface: 'AppBundle:UserEntity'
    firewall: 'main'
    collector: true
        ajax: 5
        idle: 15
        multisesion: true
        multiuser: true
# ...


  • user_interface (required): Represents the user provider entity that extends from UserInterface
  • firewall: (default: main) Defines the name of the FIREWALL to which the security.yml rules belong
  • collector: (default: true) Defines whether to show the collector in the debug bar in _profiler
  • time.ajax: (default: 5)Time in seconds it takes to perform the next query that returns active sessions
  • time.idle: (default: 15)Time in seconds to define if a user is disconnected from the system
  • allow.multiuser: (default: true) Defines whether a user is allowed to have multiple active sessions on the same IP
  • allow.multisesion: (default: true) Defines whether a user is allowed to log in multiple times at the same time

Step 5: Add a handler in the security.yml

# app/config/security.yml
# ...
    # ...
        # ...
            handlers: [ Kronhyx\SessionBundle\Event\Listener\KernelListener ]
        # ...
    # ...

Step 6: Update Entities

$ php bin/console doctrine:schema:update --force 


You can read all the documentation and functionalities of this bundle to make better use of this.


SessionBundle is a bundle for symfony framework, as it has been developed this has contributed a series of users that list here.

Security Issues

If you discover a vulnerability, a bug or have some idea to improve to propose that it leads to a better performance of this bundle, please contact us or leave your concerns here


Copyright (c) 2017. See LICENSE for details.