RE: Explanation of cookie behavior

From: Date: Thu, 15 Apr 2004 14:49:03 +0000
Subject: RE: Explanation of cookie behavior
Groups: php.general 
Request: Send a blank email to php-general+get-183465@lists.php.net to get a copy of this message
.one more note: If the user checks the "remember me" box then that's how I set the two cookes; however, if they don't click the "remember me" box then I set the cookies like this: setcookie ("authenticate_ck", "$daysRemaining"); //set cookie for active account, will terminate when browser window closes setcookie ("login_ck", "$lo"); //set cookie for active account, will terminate when browser window closes .and I can refresh the login page 1,000 times and it doesn't delete the login cookie or the authenticate cookie. Notice that when the "remember me" box is checked I set the login cookie for 30 days whereas if it's not it expires when the user closes their browser. _____ From: Ryan Schefke [mailto:ryanschefke@triomfgroup.com] Sent: Thursday, April 15, 2004 10:43 AM To: Php-General-Help (php-general@lists.php.net); 'ryanschefke@triomfgroup.com' Subject: Explanation of cookie behavior Gurus, I'm running a login script where the user enters login/password and if it matches what I have in my db and their account is active, I set a login cookie (login_ck) and an authentication cookie (authenticate_ck). If the login and authentication cookies are set when the user goes back to the login page I prompt with "welcome back.". Now, I refresh the login page a few times, sometimes it gives the welcome back prompt. Then after anywhere from 2-5 refreshes, it deletes the login cookie but the authenticate cookie persists. Any ideas why this is happening? I'm setting my cookies like this: setcookie ("authenticate_ck", "$daysRemaining"); //set cookie for active account, for 30days setcookie ("login_ck", "$lo", time()+ "60*60*24*30", "", "", "0"); //set cookie for login, for 30days Thanks, Ryan

« previous php.general (#183465) next »