Minor - format code. Moving courseInfo outside foreach.
Minor - format code.
Removing session_id=0 if session id is set see BT#7852