@@ 183-195 (lines=13) @@ | ||
180 | * @return boolean delete success boolean |
|
181 | * @since 2.0.0 |
|
182 | */ |
|
183 | public function delete($key) |
|
184 | { |
|
185 | if (isset($this->jar[$key]) and ! $this->jar[$key]->isDeleted()) |
|
186 | { |
|
187 | return $this->jar[$key]->delete(); |
|
188 | } |
|
189 | elseif ($this->has($key)) |
|
190 | { |
|
191 | return $this->parent->delete($key); |
|
192 | } |
|
193 | ||
194 | return false; |
|
195 | } |
|
196 | ||
197 | /** |
|
198 | * Get a cookie's value from the cookie jar |
|
@@ 205-217 (lines=13) @@ | ||
202 | * @return mixed |
|
203 | * @since 2.0.0 |
|
204 | */ |
|
205 | public function get($key, $default = null) |
|
206 | { |
|
207 | if (isset($this->jar[$key]) and ! $this->jar[$key]->isDeleted()) |
|
208 | { |
|
209 | return $this->jar[$key]->getValue(); |
|
210 | } |
|
211 | elseif ($this->has($key)) |
|
212 | { |
|
213 | return $this->parent->get($key, $default); |
|
214 | } |
|
215 | ||
216 | return $default; |
|
217 | } |
|
218 | ||
219 | /** |
|
220 | * Set a cookie to a new value |