[ticket/11731] Move viewonline.php session queries

PHPBB3-11731