require_once is an internal PHP way of including files while
Zend_Loader::loadClass is part of the Zend FW which is more advanced and
does the following:
- If the class has already been included this method will abort execution
(which will also prevent PHP errors from showing up);
- Tries to find the path to the file automatically
- Uses the Zend FW exception error reporting which allows you to modify
error reporting easily

I'm not familiar with the Zend_Http_Cookie class so I can't help you with
that, all I can say is that you should try the same without the path and
domain, also check if this class doesn't automatically include the timestamp
with your expiration time, if so your expiration time would be
unrealistically high and would cause problems with some browsers, like
Internet Explorer.

On Sat, Apr 5, 2008 at 5:13 PM, darren <[EMAIL PROTECTED]> wrote:

> Is there any reason why this would not be setting a cookie?  The code
> doesn't generate any errors.  It just doesn't set a cookie.  If I put
> in setcookie('name', 'value'), that will work.
>
> $cookie = md5($username . $id . "_somerandomstring_");
> Zend_Loader::loadClass("Zend_Http_Client");
> require_once "Zend/Http/Cookie.php";
> $client = new Zend_Http_Client();
> $cookie = new Zend_Http_Cookie('foo', $cookie, '.mydomain.com', time()
> + 7200, '/path');
> $client->setCookieJar();
> $client->setCookie($cookie);
>
> The code above raises a side question.  I don't want to get
> sidetracked.  But, I guess I'll ask it now, what's the difference
> between require_once and Zend_Loader::loadClass?
>
> TIA,
> Darren
>

-- 
Isaak Malik
Web Developer
[EMAIL PROTECTED]

Reply via email to