diff --git a/ctools.services.yml b/ctools.services.yml
index 046813b..eaa38b8 100644
--- a/ctools.services.yml
+++ b/ctools.services.yml
@@ -31,3 +31,8 @@ services:
   ctools.context_mapper:
     class: Drupal\ctools\ContextMapper
     arguments: ['@entity.repository']
+  ctools.serializable.tempstore.factory:
+    class: Drupal\ctools\SerializableTempstoreFactory
+    arguments: ['@keyvalue.expirable', '@lock', '@request_stack', '%user.tempstore.expire%']
+    tags:
+      - { name: backend_overridable }
diff --git a/src/SerializableTempstore.php b/src/SerializableTempstore.php
new file mode 100644
index 0000000..65567ed
--- /dev/null
+++ b/src/SerializableTempstore.php
@@ -0,0 +1,13 @@
+<?php
+
+namespace Drupal\ctools;
+
+use Drupal\Core\DependencyInjection\DependencySerializationTrait;
+use Drupal\user\SharedTempStore;
+
+/**
+ * An extension of the SharedTempStore system for serialized data.
+ */
+class SerializableTempstore extends SharedTempStore {
+  use DependencySerializationTrait;
+}
diff --git a/src/SerializableTempstoreFactory.php b/src/SerializableTempstoreFactory.php
new file mode 100644
index 0000000..51cf02b
--- /dev/null
+++ b/src/SerializableTempstoreFactory.php
@@ -0,0 +1,27 @@
+<?php
+
+namespace Drupal\ctools;
+
+use Drupal\user\SharedTempStoreFactory;
+
+/**
+ * A factory for creating SerializableTempStore objects.
+ */
+class SerializableTempstoreFactory extends SharedTempStoreFactory {
+
+  /**
+   * {@inheritdoc}
+   */
+  function get($collection, $owner = NULL) {
+    // Use the currently authenticated user ID or the active user ID unless the
+    // owner is overridden.
+    if (!isset($owner)) {
+      $owner = \Drupal::currentUser()->id() ?: session_id();
+    }
+
+    // Store the data for this collection in the database.
+    $storage = $this->storageFactory->get("user.shared_tempstore.$collection");
+    return new SerializableTempstore($storage, $this->lockBackend, $owner, $this->requestStack, $this->expire);
+  }
+
+}
diff --git a/tests/src/Kernel/SerializableTempstoreTest.php b/tests/src/Kernel/SerializableTempstoreTest.php
new file mode 100644
index 0000000..5f58e99
--- /dev/null
+++ b/tests/src/Kernel/SerializableTempstoreTest.php
@@ -0,0 +1,44 @@
+<?php
+
+namespace Drupal\Tests\ctools\Kernel;
+
+use Drupal\ctools\SerializableTempstore;
+use Drupal\KernelTests\KernelTestBase;
+use Symfony\Component\HttpFoundation\Request;
+
+/**
+ * Tests the serializable tempstore service.
+ *
+ * @group ctools
+ */
+class SerializableTempStoreTest extends KernelTestBase {
+
+  /**
+   * {@inheritdoc}
+   */
+  public static $modules = ['ctools', 'system', 'user'];
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function setUp() {
+    parent::setUp();
+    $this->installSchema('system', ['key_value_expire']);
+  }
+
+  /**
+   * Tests serializing a serializable temp store object.
+   */
+  public function testSerializableTempStore() {
+    $store = $this->container
+      ->get('ctools.serializable.tempstore.factory')
+      ->get('foobar');
+
+    $this->assertInstanceOf(SerializableTempstore::class, $store);
+    /** @var SerializableTempstore $store */
+    // With a normal tempstore, this would fail because the current request is
+    // not directly serializable.
+    $store->set('request', $this->container->get('request_stack')->getCurrentRequest());
+  }
+
+}
