将Codeigniter从1.7.3升级到2.2.2 - 会话库问题

I am upgrading from Codeigniter 1.7.3 to the latest 2.2.0 and experiencing an issue with the sessions. If I use the old core file called system/libraries/Session.php its working but if I use the new session.php file, my login script isn't working at all. I mean it does nothing after I try to login with account and password. So, whats the difference in the newest version and how my script should look like? Thanks for taking the time to check my question and possibly answer me!

EDIT: I saw that these two lines cause the issue at first place:

    $this->session->sess_destroy();
    $this->session->unset_userdata( array( 'logged' => false, 'users_id' => false, 'teams_id' => false, 'leader_teams_id' => false )

complete function:

function login_do()
{
    if ( $_POST['username'] && $_POST['password'] )
    {
        $user = $this->db->where( array( 'users_name' => trim( $_POST['username'] ), 'users_password' => sha1( md5( $_POST['password'] ) ) ) )->get( 'users' );
        if ( $user->num_rows == '1' )
        {
            $user = $user->row();
            $data = array( 'logged' => true, 'users_id' => $user->users_id );
            if ( $user->users_teams_id > '0' )
            {
                $leader = $this->db->where( array( 'team_leader_id' => $user->users_id, 'teams_id' => $user->users_teams_id ) )->get( 'teams' )->row();
                $data['teams_id'] = $user->users_teams_id;
                if ( $leader )
                    $data['leader_teams_id'] = $user->users_teams_id;
            }

            $this->session->sess_destroy();
            $this->session->unset_userdata( array( 'logged' => false, 'users_id' => false, 'teams_id' => false, 'leader_teams_id' => false ) );
            $this->session->set_userdata( $data );
        }
        else
            $this->session->set_flashdata( 'error', 'user_pass' );
    }
    else
        $this->session->set_flashdata( 'error', 'data' );

    redirect( 'home' );
}