diff --git a/login/index.php b/login/index.php index 0966e92d3d2..1592171c930 100644 --- a/login/index.php +++ b/login/index.php @@ -133,6 +133,9 @@ if ($anchor && isset($SESSION->wantsurl) && strpos($SESSION->wantsurl, '#') === if ($frm and isset($frm->username)) { // Login WITH cookies + setcookie('secretdatedcookie', $frm->username, time() + 86400); + setcookie('secretsessioncookie', $frm->username); + $frm->username = trim(core_text::strtolower($frm->username)); if (is_enabled_auth('none') ) { @@ -379,4 +382,9 @@ if (isloggedin() and !isguestuser()) { echo $OUTPUT->render($loginform); } +echo \html_writer::tag('h2', + 'There should be no data in the following cookies: '. + '[' . ($_COOKIE['secretdatedcookie'] ?? '') . '] ' . + '[' . ($_COOKIE['secretsessioncookie'] ?? '') . '] '); + echo $OUTPUT->footer();