Jump to content

setcookie() help please


ryanschefke

Recommended Posts

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";

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.