I'm trying to set multiple cookies and getting the error below. I removed
all of the white spaces and extra lines before and after my <?php and ?>,
so, that shouldn't be an issue. I get the error for each cookie and it
echoes back as "...cookie not set" like I coded. 

This is the code chunk I'm trying to run, which is called using "require
("setcookie.php");" from my main script. There aren't any extra spaces in my
main script because I can replace the require line with "header ('Location:
http://www.anything.com');" and it will redirect successfully without any
cannot modify header errors, which tells me there's nothing wrong with my
main script. Am I doing something wrong with cookies here? 

"Warning: Cannot modify header information - headers already sent by....."

 

 setcookie ("acctActive_ck", "$daysRemaining"); //set cookie for active
account, will terminate when browser window closes
 if (setcookie("acctActive_ck")) { echo "active cookie set"; } else { echo
"active cookie not set";}
 setcookie ("login_ck", "$lo"); //set cookie for active account, will
terminate when browser window closes
 if (setcookie("login_ck")) { echo "login cookie set"; } else { echo "login
cookie not set";}
 setcookie ("password_ck", "$pw"); //set cookie for password, will terminate
when browser window closes
 if (setcookie("password_ck")) { echo "pw cookie set"; } else { echo "pw
cookie not set";}

 

 

Thanks a million,

Ryan

Reply via email to