Added session validation checks