]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/User/Cookie.php
Funkwhale context file moved
[friendica.git] / src / Model / User / Cookie.php
index aabb0282094f35780ed39779a31d7a9797498c4a..4359d21071d73923185fc69ac9b9e2118e54c141 100644 (file)
@@ -124,6 +124,19 @@ class Cookie
                }
        }
 
+       /**
+        * Resets the cookie to a given data set
+        *
+        * @param array $data
+        *
+        * @return bool
+        */
+       public function reset(array $data): bool
+       {
+               return $this->clear() &&
+                          $this->setMultiple($data);
+       }
+
        /**
         * Clears the Friendica cookie
         */
@@ -131,7 +144,7 @@ class Cookie
        {
                $this->data = [];
                // make sure cookie is deleted on browser close, as a security measure
-               return $this->setCookie( '', -3600, $this->sslEnabled);
+               return $this->setCookie('', -3600, $this->sslEnabled);
        }
 
        /**
@@ -161,7 +174,7 @@ class Cookie
         *
         */
        protected function setCookie(string $value = null, int $expire = null,
-                                    bool $secure = null): bool
+                                                                bool $secure = null): bool
        {
                return setcookie(self::NAME, $value, $expire, self::PATH, self::DOMAIN, $secure, self::HTTPONLY);
        }