diff --git a/core/includes/bootstrap.inc b/core/includes/bootstrap.inc index 3ec95da..05319e9 100644 --- a/core/includes/bootstrap.inc +++ b/core/includes/bootstrap.inc @@ -639,7 +639,7 @@ function drupal_valid_test_ua($new_prefix = NULL) { // The file properties add more entropy not easily accessible to others. $key = $private_key . filectime(__FILE__) . fileinode(__FILE__); $test_hmac = Crypt::hmacBase64($check_string, $key); - // Check that the HMAC match. + // Check that the HMAC matches. if ($hmac === $test_hmac) { $test_prefix = $prefix; } @@ -671,7 +671,7 @@ function drupal_generate_test_ua($prefix) { else { // Generate and save a new hash salt for a test run. // Consumed by drupal_valid_test_ua() before settings.php is loaded. - $private_key = Crypt::randomBytesBase64(55); + $private_key = Crypt::randomBytesBase64(110); file_put_contents($key_file, $private_key); } // The file properties add more entropy not easily accessible to others. diff --git a/core/tests/Drupal/FunctionalJavascriptTests/Core/Session/SessionTest.php b/core/tests/Drupal/FunctionalJavascriptTests/Core/Session/SessionTest.php index 718b6d2..1785aee 100644 --- a/core/tests/Drupal/FunctionalJavascriptTests/Core/Session/SessionTest.php +++ b/core/tests/Drupal/FunctionalJavascriptTests/Core/Session/SessionTest.php @@ -3,7 +3,6 @@ namespace Drupal\FunctionalJavascriptTests\Core\Session; use Drupal\FunctionalJavascriptTests\JavascriptTestBase; -use Drupal\user\Entity\User; /** * Tests that sessions don't expire. @@ -18,27 +17,25 @@ class SessionTest extends JavascriptTestBase { public static $modules = ['user', 'views', 'node']; /** - * @var User - * The current logged in user. - */ - protected $user; - - /** * {@inheritdoc} */ protected function setUp() { parent::setUp(); - $this->user = $this->drupalCreateUser([ + $user = $this->drupalCreateUser([ 'administer site configuration', 'access administration pages', 'access content overview', ]); - $this->drupalLogin($this->user); + $this->drupalLogin($user); } /** * Tests that the session doesn't expire. + * + * Makes sure that drupal_valid_test_ua() works for multiple requests + * performed by the Mink browser. The SIMPLETEST_USER_AGENT cookie must always + * be valid. */ public function testSessionExpiration() { // Visit the admin page and click on Title sort 15 times.