public function setUserLoggedIn(AdminUser $user): string
    {
        $_SESSION['admin_logged'] = true;
        $_SESSION['admin_id'] = $user->getId();
        $_SESSION['admin_login'] = $user->getLogin();
        $_SESSION['admin_sid'] = Users::getInstance()->startSession($user->getId());

        if (!defined('USER_ID')) {
            define('USER_ID', $user->getId());
        }

        App::add('User "' . $user->getLogin() . '" logged in.');

        return $_SESSION['admin_sid'];
    }
public function setUserLoggedIn(AdminUser $user): string
    {
        $_SESSION['admin_logged'] = true;
        $_SESSION['admin_id'] = $user->getId();
        $_SESSION['admin_login'] = $user->getLogin();
        $_SESSION['admin_sid'] = Users::getInstance()->startSession($user->getId());

        if (!defined('USER_ID')) {
            define('USER_ID', $user->getId());
        }

        App::add('User "' . $user->getLogin() . '" logged in.');

        return $_SESSION['admin_sid'];
    }
public function setUserLoggedIn ( AdminUser $ user ) : string { $ _SESSION [ 'admin_logged' ] = true ; $ _SESSION [ 'admin_id' ] = $ user -> getId ( ) ; $ _SESSION [ 'admin_login' ] = $ user -> getLogin ( ) ; $ _SESSION [ 'admin_sid' ] = Users :: getInstance ( ) -> startSession ( $ user -> getId ( ) ) ; if ( ! defined ( 'USER_ID' ) ) { define ( 'USER_ID' , $ user -> getId ( ) ) ; } App :: add ( 'User "' . $ user -> getLogin ( ) . '" logged in.' ) ; return $ _SESSION [ 'admin_sid' ] ; }
After that user is logged-in

@param AdminUser $user

@return string session id
After that user is logged - in