[ticket/11731] Move ucp.php session queries

PHPBB3-11731