Sfoglia il codice sorgente

Cookie optimizations

walkor 2 anni fa
parent
commit
a2a787757f
1 ha cambiato i file con 7 aggiunte e 0 eliminazioni
  1. 7 0
      src/Protocols/Http/Request.php

+ 7 - 0
src/Protocols/Http/Request.php

@@ -175,6 +175,13 @@ class Request
         if (!isset($this->data['cookie'])) {
             $this->data['cookie'] = [];
             parse_str(preg_replace('/; ?/', '&', $this->header('cookie', '')), $this->data['cookie']);
+            foreach ($this->data['cookie'] as $key => $value) {
+                if ($key[0] ?? '' === '$') {
+                    unset($this->data['cookie'][$key]);
+                    continue;
+                }
+                $this->data['cookie'][$key] = trim($value, '"');
+            }
         }
         if ($name === null) {
             return $this->data['cookie'];