diff --git a/modules/masquerade/src/Cache/MasqueradeCacheContext.php b/modules/masquerade/src/Cache/MasqueradeCacheContext.php
index 6d1aae6..3d822f0 100644
--- a/modules/masquerade/src/Cache/MasqueradeCacheContext.php
+++ b/modules/masquerade/src/Cache/MasqueradeCacheContext.php
@@ -30,10 +30,7 @@ public static function getLabel() {
    * {@inheritdoc}
    */
   public function getContext() {
-    return $this->requestStack
-      ->getCurrentRequest()
-      ->getSession()
-      ->has('masquerading');
+    return (isset($_SESSION['masquerading']));
   }
 
   /**
