private function getUserFromSession($sid) {
        $session = $this->entityManager->getRepository("Emeric0101\PHPAngular\Entity\Session")->findBySid($sid);
        if (empty($session)) {
            return null;
        }
        // fix some bug with entity conflit
        $userLogged = $this->entityManager->find("Emeric0101\PHPAngular\Entity\IUser", $session[0]->getUser()->getId());

        return $userLogged;
    }