public function restoreCookies($file) { $json = file_get_contents($file); $a = json_decode($json); $this->cookies = []; foreach ($a as $jsonCookie) { $cookie = new SimpleCookie(); $cookie->wakeUp($jsonCookie); $this->cookies[] = $cookie; } }