What was the purpose of the flight?
The student can log it if:
If it was an instructional flight with the direction of a flight instructor who will sign the students log book.
The student (with the proper endorcements-student pilot or pilot certificate) was alone in the aircraft.
The student cannot log it if:
The student was in a pilot seat going for a ride (not instruction). In this case if the CFI says it was not an instruction flight, then tell the student they cannot log it.
Note: the right or left seat doesn't matter, what matters is who is Pilot in command, what certificate or type of training is being done.
JAFI