[2.8] Trigger an event in CakeSessionHandlerInterface


Is it possible to trigger an event in CakeSessionHandlerInterface?



App::uses('DatabaseSession', 'Model/Datasource/Session');
App::uses('CakeEventListener', 'Event');

class CompositSession extends DatabaseSession implements CakeSessionHandlerInterface {
public $cacheKey;

public function __construct() {
    $this->cacheKey = Configure::read('Session.handler.cache');

// Lit les données à partir d'une session.
public function read($id) {
    $result = Cache::read($id, $this->cacheKey);
    if ($result) {
        return $result;
    return parent::read($id);

// écrit les données dans la session.
public function write($id, $data) {
    Cache::write($id, $data, $this->cacheKey);  
    $eventListner = new CakeEvent('CompositSession.Write', $this);  
    return parent::write($id, $data);

//     détruit une session.
public function destroy($id) {
    Cache::delete($id, $this->cacheKey);
    return parent::destroy($id);

// retire les sessions expirées.
public function gc($expires = null) {
    return parent::gc($expires);



I get this error

Fatal error: Call to a member function getEventManager() on a non-object in app\Model\Datasource\Session\CompositSession.php

Thank you,