diff --git a/lib/classes/StudipArrayObject.class.php b/lib/classes/StudipArrayObject.class.php
index fe9aad1762262282fb929b0da5e0733a36dca177..ec915a645ef1cca4de6e4e14383bdb9d3862522c 100644
--- a/lib/classes/StudipArrayObject.class.php
+++ b/lib/classes/StudipArrayObject.class.php
@@ -134,6 +134,38 @@ class StudipArrayObject implements IteratorAggregate, ArrayAccess, Serializable,
         return $this->$key;
     }
 
+    /**
+     * Called when serializing an ArrayObject
+     */
+    public function __serialize(): array
+    {
+        return get_object_vars($this);
+    }
+
+    /**
+     * Called when unserializing an ArrayObject
+     */
+    public function __unserialize(array $data): void
+    {
+        foreach ($data as $k => $v) {
+            switch ($k) {
+                case 'flag':
+                    $this->setFlags($v);
+                    break;
+                case 'storage':
+                    $this->exchangeArray($v);
+                    break;
+                case 'iteratorClass':
+                    $this->setIteratorClass($v);
+                    break;
+                case 'protectedProperties':
+                    break;
+                default:
+                    $this->__set($k, $v);
+            }
+        }
+    }
+
     /**
      * Appends the value
      *