Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:12201 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 96019 invoked by uid 1010); 17 Aug 2004 23:18:39 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 95937 invoked from network); 17 Aug 2004 23:18:38 -0000 Received: from unknown (HELO mail.zend.com) (80.74.107.235) by pb1.pair.com with SMTP; 17 Aug 2004 23:18:38 -0000 Received: (qmail 10209 invoked from network); 17 Aug 2004 23:18:34 -0000 Received: from localhost (HELO AndiNotebook.zend.com) (127.0.0.1) by localhost with SMTP; 17 Aug 2004 23:18:34 -0000 Message-ID: <5.1.0.14.2.20040817161212.044edd50@127.0.0.1> X-Sender: andi@127.0.0.1 X-Mailer: QUALCOMM Windows Eudora Version 5.1 Date: Tue, 17 Aug 2004 16:17:59 -0700 To: internals@lists.php.net Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Subject: setcookie() and Max-Age From: andi@zend.com (Andi Gutmans) Hey, There's a very interesting user contributed note for the setcookie() function (Follows in the end). I think it makes sense to support Max-Age because it fixes clock skew problems between the client and server. Not sure if an how this could be added to setcookie() because of the already rich amount of parameters it accepts. Would it make sense to have something like setcookie_max_age() or something similar? Andi add a note User Contributed Notes setcookie mr-yellow at mr-yellow dot com 15-Aug-2004 10:14 Sorry Secure not Secure=1.... Instead of setcookie it would be much safer to use the new better specs and send the following. A 1 hour cookie is as follows: header('Set-Cookie: TestCookie=something+from+somewhere; Max-Age=3600; Domain=.www.domain.com; Path=/; secure;'); To Delete a cookie set -1: header('Set-Cookie: TestCookie=something+from+somewhere; Max-Age=-1; Domain=.www.domain.com; Path=/; secure;'); -Ben