Good night, there is such code in the login.php file:
if ( $_SERVER[ 'REQUEST_METHOD' ] == 'POST' ) { if ( !isset( $_SESSION[ 'csrf' ] ) || $_SESSION[ 'csrf' ] !== $_POST[ 'csrf' ] ) throw new RuntimeException( 'CSRF attack' ); } $key = sha1( microtime() ); $_SESSION[ 'csrf' ] = $key; Because of this code, the following error is generated in the logs:
PHP Fatal error: Uncaught exception 'RuntimeException' with message 'CSRF attack' in /var/www/login.php:26\nStack trace: \ n # 0 {thrown in /var/www/login.php on line 26, referer: www.travianx5.ru/login.php
Can you explain what the above code does? And how do I get rid of this error?