]> git.mxchange.org Git - friendica.git/blobdiff - src/Core/Session/Type/AbstractSession.php
Merge pull request #12021 from nupplaphil/feat/session_util
[friendica.git] / src / Core / Session / Type / AbstractSession.php
index a24b6e478e1271e3cfa03096725f928f6c4e1d82..0e2f884a327c1f0cea5155e7de9ad8991575ef70 100644 (file)
@@ -52,6 +52,20 @@ class AbstractSession implements IHandleSessions
                return $_SESSION[$name] ?? $defaults;
        }
 
+       /**
+        * {@inheritDoc}
+        */
+       public function pop(string $name, $defaults = null)
+       {
+               $value = $defaults;
+               if ($this->exists($name)) {
+                       $value = $this->get($name);
+                       $this->remove($name);
+               }
+
+               return $value;
+       }
+
        /**
         * {@inheritDoc}
         */