瀏覽代碼

fix disconnect utility

Olivier Massot 4 年之前
父節點
當前提交
0c2bc9bc8c
共有 1 個文件被更改,包括 3 次插入7 次删除
  1. 3 7
      ot_connect/Classes/Service/OtAuthenticationService.php

+ 3 - 7
ot_connect/Classes/Service/OtAuthenticationService.php

@@ -429,15 +429,11 @@ class OtAuthenticationService extends AbstractAuthenticationService
      * Unset a cookie by reducing its expiration date
      *
      * @param string $name
-     * @return bool
      */
-    protected function unset_cookie(string $name): bool
+    protected function unset_cookie(string $name)
     {
-        $res = setcookie($name, '', 1, '/', $_SERVER['HTTP_HOST']);
-        if (!$res) {
-            $this->writeLogMessage('Error while unsetting ' . $name . ' cookie');
-        }
-        return $res;
+        setcookie($name, '', 1, '/', $_SERVER['HTTP_HOST']); // for custom domains (not in .opentalent.fr)
+        setcookie($name, '', 1, '/', self::COOKIE_DOMAIN);   // for opentalent.fr subdomains
     }
 
     /**