Re: pulling my hair out

From: Date: Thu, 12 Jul 2001 07:08:27 +0000
Subject: Re: pulling my hair out
Groups: php.db 
Request: Send a blank email to php-db+get-10328@lists.php.net to get a copy of this message
Hi, As I can see you're trying to set a cookie that has expired an hour ago. May be you could try to modify the setcookie() arguments to something like this setcookie ("logged_in", "yes", time() + 3600); setcookie ("logged_user_name", "brad", time() + 3600); This will make your cookies to expire after an hour. If you want to set a Cookie that will expire when the browser is closed you can replace time()+3600 with 0. Dobromir Velev -----Original Message----- From: Brad Lipovsky <syzme@home.com> To: php-db@lists.php.net <php-db@lists.php.net> Date: Thursday, July 12, 2001 7:19 AM Subject: [PHP-DB] pulling my hair out >I have one script that looks like this: > ><?php >setcookie ("logged_in", "yes", time() - 3600); >setcookie ("logged_user_name", "brad", time() - 3600); >?> > ><html> ><head> ></head> ><body> >SENT ></body> ></html> > >and another that looks like this: > ><?php >print "start <br>"; >echo $HTTP_COOKIE_VARS["logged_in"]; >print "<br>"; >echo $logged_user_name; >print "<br>"; >print "end"; >?> > >which I have also tried like this: > ><?php >print "<br>"; >echo $logged_in; >print "<br>"; >echo $logged_user_name; >?> > >It seems like this should be extremely simple, but when I run the first one, >and then the second one, the second one only writes the <br>'s to the >document. It also doesnt trigger my browser (tried in netscape and ie5) to >alert me that a cookie is being sent, I turned that option on just to test >this script. >Please Help! > > >Brad > > > >-- >PHP Database Mailing List (http://www.php.net/) >To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net >For additional commands, e-mail: php-db-help@lists.php.net >To contact the list administrators, e-mail: php-list-admin@lists.php.net > >

« previous php.db (#10328) next »