]> git.mxchange.org Git - friendica-addons.git/blobdiff - diaspora/diasphp.php
Addon class
[friendica-addons.git] / diaspora / diasphp.php
index 589a581010495aaf6b9bb9ac86edc878875d0eca..6ed0c8ce5319f87af36427ecff953f3cd64011b0 100644 (file)
@@ -5,6 +5,8 @@
  */
 
 class Diasphp {
+       private $cookiejar;
+
        function __construct($pod) {
                $this->token_regex = '/content="(.*?)" name="csrf-token/';
 
@@ -12,6 +14,11 @@ class Diasphp {
                $this->cookiejar = tempnam(sys_get_temp_dir(), 'cookies');
        }
 
+       function __destruct() {
+               if (file_exists($this->cookiejar))
+                       unlink($this->cookiejar);
+       }
+
        function _fetch_token() {
                $ch = curl_init();