Session: added validation for session ID value [Closes #965]