@@ -70,8 +70,12 @@ |
||
| 70 | 70 | */ |
| 71 | 71 | public function cookie($key = null, $default = null) |
| 72 | 72 | { |
| 73 | - if ($this->cookie === null) return $this->cookie = $_COOKIE; |
|
| 74 | - if ($key === null) return $this->cookie; |
|
| 73 | + if ($this->cookie === null) { |
|
| 74 | + return $this->cookie = $_COOKIE; |
|
| 75 | + } |
|
| 76 | + if ($key === null) { |
|
| 77 | + return $this->cookie; |
|
| 78 | + } |
|
| 75 | 79 | return isset($this->cookie[$key]) ? $this->cookie[$key] : $default; |
| 76 | 80 | } |
| 77 | 81 | |