Dan, thanks for that, I doubt I'd ever have found it.   Looks like you could do a query before the



if (to_imp == gs.getImpersonatingUserName())


  session.onlineUnimpersonate();


else if (to_imp != gs.getUser().getID())


  doImpersonate(to_imp);



And then just add an && condition to the else if...



Great stuff!   Thank you.