After updating to PHP7 I have some problems with my applications sessionhandling.
It doesn't seem to be a big problem but PHP throws this error everytime:
[18-Jun-2016 20:49:10 UTC] PHP Warning:  session_decode(): Session is not active. You cannot decode session data in /var/www/app/phpsessionredis.php on line 90
The session_handler is nothing special. It stores JSONified sessiondata to redis etc.
class phpsessionredis implements \SessionHandlerInterface {
    public function __construct( &$redis ) {
        $this->__rc = $redis;
    }
    public function open($savePath, $sessionName) {
        return true;
    }
    public function destroy($id) {
        try { $this->__rc->del($id); } 
        catch (\RedisException $e) { return false; }
    }
    public function close() {
        return true;
    }
    public function write($id, $data) {
        session_decode($data); // throws an error
        try{
            $this->__rc->setex( $id, 3600, json_encode($_SESSION) );
        } catch (\RedisException $e) { return false; }
        return true;
    }
    public function read($id) {
        try {
          $r = $this->__rc
          ->multi()
          ->get($id)
          ->expire($id, 3600)
          ->exec();
        } catch (\RedisException $e) { return false; }
        $_SESSION = json_decode( $r[0], true );
        if( isset( $_SESSION ) && ! empty( $_SESSION ) && $_SESSION != null ){
            return session_encode();
        } 
        return ''; 
    }
    public function gc($maxLifetime) {
        return true;
    }
}
$sessionhandler = new phpsessionredis( $redis );
session_set_save_handler($sessionhandler);
ob_start();
session_start();
Any help is welcome.
 
    