Session slim framework

I have this https://github.com/bryanjhv/slim-session

$app->post(’/login/’, function ($request,$response) {
$data = $request->getParsedBody();
$crm_data = [];
$username = filter_var($data[‘user’], FILTER_SANITIZE_STRING);
$pass = filter_var($data[‘pass’], FILTER_SANITIZE_STRING);
$db = $this->db;
$stmt = $db->prepare(“SELECT id FROM user WHERE username =’$username’ and pass = ‘$pass’”);
$stmt->execute();
$row = $stmt->fetch();
if(isset($row[‘id’])){

	$this->session['dummy_session'] = $row['id'];
	echo $this->session['dummy_session'];

}else{
	echo 0;
}

});

but in this part
$app->post(’/crm/new_field/’, function ($request,$response) {
echo $this->session[‘userid’];

It is not valued I put the plugin as global

Thanks