RE: set cookie function problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



You might consider using JavaScript to set the cookie, as that will
execute on the client and therefore use the client's time to make any
calculations regarding expiry. This may or may not suit your purpose.

Mark

-----Original Message-----
From: Richard Lynch [mailto:ceo@xxxxxxxxx] 
Sent: 20 April 2005 04:18
To: Ospinto
Cc: php-general@xxxxxxxxxxxxx
Subject: Re:  set cookie function problem


On Tue, April 19, 2005 2:20 pm, Ospinto said:
> Can someone help me with this problem? setcookie('myCookie',"blah");
> works fine. but when i try to set it with an expiry time, it doesn't.
> setcookie('myCookie',"blah",time()+3600);
>
> I have cookies enabled on my browser of course. And the way I know the

> second statement is not working is cos I'm doing a var_dump of 
> $_COOKIES. Thanks for your help.

If the user's computer clock is way out of whack, and you are setting a
cookie to expire in 1 hour, you're likely to have problems...

Though *maybe* browsers account for this by comparing your Date: header
and your clock time, and ignore the user clock.

For sure, though, *some* versions of IE will *NOT* work when you set a
Cookie time, but not a path.

That's because the Microsoft engineers mis-read the Cookie spec (on
purpose perhaps) and require *both* time and path, or neither, but not
just path.

YMMV

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Gamma Global : Suppliers of HPCompaq, IBM, Acer, EPI, APC, Cyclades, D-Link, Cisco, Sun Microsystems, 3Com

GAMMA GLOBAL (UK) LTD IS A RECOGNISED 'INVESTOR IN PEOPLE' AND AN 'ISO 9001 2000' REGISTERED COMPANY

**********************************************************************

CONFIDENTIALITY NOTICE:

This Email is confidential and may also be privileged. If you are not the
intended recipient, please notify the sender IMMEDIATELY; you should not
copy the email or use it for any purpose or disclose its contents to any
other person.

GENERAL STATEMENT:

Any statements made, or intentions expressed in this communication may not
necessarily reflect the view of Gamma Global (UK) Ltd. Be advised that no content
herein may be held binding upon Gamma Global (UK) Ltd or any associated company
unless confirmed by the issuance of a formal contractual document or
Purchase Order,  subject to our Terms and Conditions available from http://www.gammaglobal.com

E&OE

**********************************************************************
**********************************************************************


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux