roll back-in changes to remote send plus fix missing update of $session['userid']