Impersonating a User from a plugin, with specific page redirect
Since this is an action in your own plugin's controller, you can literally do anything you want after the login happens.

if (craft()-&gt;userSession-&gt;loginByUserId($orderOwnerId))
{
    $this-&gt;redirect('https://www.reddit.com/');
}



  if I uncomment the $this-&gt;_handleSuccessfulLogin(true); line I get an error.


Because that's a private method you probably didn't copy over from Craft's UsersController.php.  You don't have to use it if you don't want to.


  it says the function is deprecated (https://craftcms.com/classreference/services/UsersService#handleSuccessfulLogin-detail)


Same method name (mostly), but not in the UsersController... it's on the UsersService.  It's also public, not private.