Minor - adding comments, cosmetic changes
Fixing session history page in order to use userportal/history instead of user_portal.php?history=1
Fixing PHP notices