src/SudoSu.php
public function loginAsUser($userId, $originalUserId)
    {
        $this->session->put('sudosu.has_sudoed', true);
        $this->session->put($this->sessionKey, $originalUserId);

        $this->auth->loginUsingId($userId);
    }
public function loginAsUser($userId, $originalUserId)
    {
        $this->session->put('sudosu.has_sudoed', true);
        $this->session->put($this->sessionKey, $originalUserId);

        $this->auth->loginUsingId($userId);
    }
public function loginAsUser ( $ userId , $ originalUserId ) { $ this -> session -> put ( 'sudosu.has_sudoed' , true ) ; $ this -> session -> put ( $ this -> sessionKey , $ originalUserId ) ; $ this -> auth -> loginUsingId ( $ userId ) ; }
Stores the ID of the current user in the session so we can return
back to the original account later, then logs the user in
as the user with the given ID.

@param integer $userId
@param integer $originalUserId
@return void
Stores the ID of the current user in the session so we can return back to the original account later then logs the user in as the user with the given ID .