Fat Free框架PHP - 基于变量创建不同的会话

I am trying to create a session for user and another for admin based on a variable which gets the status (from database) of the username. I have managed to create a session for user but it doesn't seem to work for admin. I get an error Undefined index: user, when I try to login as admin and I dont know whats causing the problem.

How do I create a different session for admin?

This is the code written in the controller:

        $user = new Login($this->db);
        $user->getByName($username);

        if ($s['status'] == 'user'){
        $this->f3->set('SESSION.user', $user->username);
        $this->f3->reroute('/');
    }


        if ($s['status'] == 'admin'){

        $this->f3->set('SESSION.admin', $user->username);
        $this->f3->reroute('/');
    }

I guess, the status variable can have only one value at a time, in that case you need to have an else in the if condition

if ($s['status'] == 'user'){
   $this->f3->set('SESSION.user', $user->username);
   $this->f3->reroute('/');
} else if ($s['status'] == 'admin'){
   $this->f3->set('SESSION.admin', $user->username);
   $this->f3->reroute('/');
}