diff --git a/Http.php b/Http.php index 20b590b..b8a11c5 100644 --- a/Http.php +++ b/Http.php @@ -181,6 +181,29 @@ public function getHeadersFormatted ( ) { return $out; } + /** + * Get Cookies. + * + * @access public + * @return array + * @author Kevin Olson + */ + public function getCookieParams ( ) { + + $out = array(); + $headers = $this->getHeadersFormatted(); + + if (isset($headers['COOKIE']) && !empty($headers['COOKIE'])) { + foreach (split(';', $headers['COOKIE']) as $string) { + $kv = split('=', $string); + $out[ltrim($kv[0])] = rawurldecode($kv[1]); + } + } + + + return $out; + } + /** * Check if header exists. *