ryanschefke Posted November 25, 2007 Share Posted November 25, 2007 Hello All, I am trying to set a cookie and debug if it is set. For some reason it is not getting set. I posted the script where I set the cookies. See Lines 58-60: http://phpfi.com/278814 I am trying to echo the cookies on a separate page, which I also posted at http://phpfi.com/278817, on line 4. This is a simple line though for a test and nothing is showing up. The line is echo "test: for login $login_ck"; Quote Link to comment Share on other sites More sharing options...
revraz Posted November 25, 2007 Share Posted November 25, 2007 If you want to test setting cookies, don't put them in a IF statement. Just write a small script that sets the cookie then see if it works. If so, then you know it's working and then incorporate it into your code. If it doesn't, it's much easier to troubleshoot. Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted November 25, 2007 Share Posted November 25, 2007 Check your web server log for errors and/or turn on full php error reporting. It is likely (I did not look at the code) that you are outputting content to the browser and that is preventing the cookie from being sent. Quote Link to comment Share on other sites More sharing options...
ryanschefke Posted November 26, 2007 Author Share Posted November 26, 2007 okay, so I tested it and it is setting the cookie fine. I used this script, http://phpfi.com/278823. However, when I run the scripts above it is not setting it. What else is in the script that would be causing it to not set the cookie? By the way, in place of the $row_customer[5] in the activation script I entered in a word in case my MySQL query wasnt working but that still didnt work so it is something in the script that is making it not get set. Thanks for checking out the scripts. Ryan Quote Link to comment Share on other sites More sharing options...
ryanschefke Posted November 26, 2007 Author Share Posted November 26, 2007 hello - That was the problem. I was outputing something to the browser using some echos at the top to test the script. I removed those and the cookie is properly set now. Thank you! Quote Link to comment Share on other sites More sharing options...
revraz Posted November 26, 2007 Share Posted November 26, 2007 Right on, mark the topic as solved if you can. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.