diff --git a/src/Cookie/ContextCookie.php b/src/Cookie/ContextCookie.php new file mode 100644 index 0000000..953e2eb --- /dev/null +++ b/src/Cookie/ContextCookie.php @@ -0,0 +1,49 @@ +getContext()->cookies()->has($this->name(), $checkQueued); + } + + public function read(bool $checkQueued = true) + { + return $this->_setRawValue($this->getContext()->cookies()->read($this->name(), $checkQueued)); + } + + protected function _getRawValue(): ?string + { + return $this->_rawValue; + } + + protected function _setRawValue(string $value) + { + $this->_rawValue = $value; + return $this; + } + + public function store() + { + $this->getContext()->cookies()->store($this->name(), $this->_getRawValue(), $this->ttl()); + return $this; + } +}