Fixing funtion load_session_categories in order to load all categories.

See #7153
Minor - format code.
Minor - format code.
Adding session id see #7153