Fixed #1123: Review - PHP session handling
CS fixes + small fixes