Getting same issue during login when using JMeter.
Our environment : Moodle 3.10 and JMeter 5.x version.
and it solve when we change JMeter version to old version.
I just put the download link bellow
found jmeter 2.5.1 version and do not forget to custom jmeter memory on jmeter.sh.