diff --git a/core/includes/bootstrap.inc b/core/includes/bootstrap.inc
index ec12097..722d7f8 100644
--- a/core/includes/bootstrap.inc
+++ b/core/includes/bootstrap.inc
@@ -642,7 +642,7 @@ function drupal_valid_test_ua($new_prefix = NULL) {
     $test_hmac = Crypt::hmacBase64($check_string, $key);
     // Since we are making a local request a 5 second time window is allowed,
     // and the HMAC must match.
-    if ($time_diff >= 0 && $time_diff <= 5 && $hmac === $test_hmac) {
+    if ($time_diff >= 0 && $time_diff <= 180 && $hmac === $test_hmac) {
       $test_prefix = $prefix;
     }
   }
diff --git a/core/tests/Drupal/FunctionalJavascriptTests/Core/Session/SessionTest.php b/core/tests/Drupal/FunctionalJavascriptTests/Core/Session/SessionTest.php
new file mode 100644
index 0000000..1b833ce
--- /dev/null
+++ b/core/tests/Drupal/FunctionalJavascriptTests/Core/Session/SessionTest.php
@@ -0,0 +1,58 @@
+<?php
+
+namespace Drupal\FunctionalJavascript\Core\Session;
+
+use Drupal\FunctionalJavascriptTests\JavascriptTestBase;
+use Drupal\user\Entity\User;
+
+/**
+ * Tests that sessions don't expire.
+ *
+ * @group session
+ */
+class SessionTest extends JavascriptTestBase {
+
+  /**
+   * {@inheritdoc}
+   */
+  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([
+      'administer site configuration',
+      'access administration pages',
+      'access content overview',
+    ]);
+    $this->drupalLogin($this->user);
+  }
+
+  /**
+   * Tests that the session doesn't expire.
+   */
+  public function testSessionExpiration() {
+    // Visit the admin page and click on Title sort 15 times.
+    $this->drupalGet('admin/content');
+
+    $session_assert = $this->assertSession();
+
+    $page = $this->getSession()->getPage();
+
+    for ($i = 0; $i < 15; $i++) {
+      $page->clickLink('sort by Title');
+      $session_assert->assertWaitOnAjaxRequest();
+      $session_assert->statusCodeEquals(200);
+    }
+  }
+
+}
