Re: non-expiring cookie

From: Date: Sat, 26 Aug 2000 07:00:56 +0000
Subject: Re: non-expiring cookie
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-13775@lists.php.net to get a copy of this message
well, you can have it not expire at least until UNIX expires: setcookie('c_Name', 'value', mktime(19,14,07,1,18,2038)); -jeremy brand _______________________________________________________________________ GnuPG Fingerprint: 9F5E 95E0 1CC2 E054 84EA 6099 8ACD 9DBA D2C0 5EA9 _ http://www.JeremyBrand.com/Jeremy/Brand/Jeremy_Brand.html for more __ On Fri, 25 Aug 2000, Wizaerd wrote: > Date: Fri, 25 Aug 2000 23:49:24 -0700 > From: Wizaerd <wizaerd@wizaerd.com> > To: General PHP List <php-general@lists.php.net> > Subject: [PHP] non-expiring cookie > > How can I create a cookie that never expires? I'm using the following code: > > // initially set the cookies (non-expiring I hope) > if( !isset( $c_Name )) { setcookie( "c_Name", "", 0 ); } > if( !isset( $c_EMail )) { setcookie( "c_EMail", "", 0 ); } > if( !isset( $c_WebURL )) { setcookie( "c_WebURL", "", 0 ); } > if( !isset( $c_WebTitle )) { setcookie( "c_WebTitle", "", 0 ); } > > // if the form is being submitted, update cookie values > if( isset( $frm_SaveThem )) { > setcookie( "c_Name", $c_Name, 0 ); > setcookie( "c_EMail", $c_EMail, 0 ); > setcookie( "c_WebURL", $c_WebURL, 0 ); > setcookie( "c_WebTitle", $c_WebTitle, 0 ); > } > > However, they are only persistant during the browser session. > > The second problem I have is they do not seem to update with a new value if > the contents of the variable changes... this code is stored in an > application.php which gets prepended automatically, and does occur before > any other output. > > Thanx! > > Joseph E. Sheble > a.k.a. Wizaerd > Wizaerd's Realm > Canvas, 3D, Graphics, ColdFusion > http://www.wizaerd.com > ================================= > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > >

« previous php.general (#13775) next »