Based on the information you provided, I assume that you are trying to set cmi.session_time and get cmi.total_time in the same student session that would not give the answer you are expecting.
cmi.total_time contains the total duration of all student sessions until the current one , which means that it will not contain the value that you expect from it until the second lesson.
After you set cmi.session_time , close the current student session, leaving SCO where you are, and then return to it. Then you should see that cmi.total_time now filled with a valid value.
Good luck
E-man source share