From 8f832dcba3ca846b5ef22cb8c4b3168d744f5418 Mon Sep 17 00:00:00 2001 From: xue <> Date: Sat, 4 Mar 2006 22:45:47 +0000 Subject: Added findCookieByName. --- framework/Web/THttpRequest.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/framework/Web/THttpRequest.php b/framework/Web/THttpRequest.php index 029fb240..293c73f1 100644 --- a/framework/Web/THttpRequest.php +++ b/framework/Web/THttpRequest.php @@ -737,6 +737,19 @@ class THttpCookieCollection extends TList $this->_o->removeCookie($item); return $item; } + + /** + * Finds the cookie with the specified name. + * @param string the name of the cookie to be looked for + * @return THttpCookie the cookie, null if not found + */ + public function findCookieByName($name) + { + foreach($this as $cookie) + if($cookie->getName()===$name) + return $cookie; + return null; + } } /** -- cgit v1.2.3