Jump to content

BillyB

New Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

BillyB's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I've finally found the answer. There is a LIMIT to the number of cookies that PHP can handle. That limit is 20! By using Garethp's print_r($_COOKIE); command I had, indeed, exceeded the Cookie Threshold. I did a bit more searching on the Interweb and came across this possible solution, which I will be trying out tomorrow. PHP Cookie limit Wondering why some cookies are not set? The maximum number is 20. The maximum total size only 2 KB. They are set in the reverse direction of the script. And they must be accessed by the same directory in which they have been set. If you use 'include' the original script will determine the active directory, not the included one. You can exceed the number of 20 by putting the values into one string seperating with a character of you choice: $all="$a;$b;$c;$d"; setcookie('all',$all,time()+10000); and unpack it with explode: $x=$_COOKIE['all']; $y=explode(';',$x); // ';' is the seperator $a=$y[0];$b=$y[1]; and so on..... Thank you for your help.
  2. Hello all. Newbie here. I have a question regarding cookies. I have set two cookies in script #1, namely EditingTraining and EditSPMarketing, but only seem to be able to read one of them in script #2. Excerpts from the script are below. I'm hoping the problem has something to do with the way that I've coded the scripts, but am really quite perplexed as to why this isn't working. Script #1 setcookie("EditTraining", $row['EditTraining'], time()+5184000, '/'); setcookie("EditSPMarketing", $row['EditSPMarketing'], time()+5184000, '/'); Script #2 $EditTraining = $_COOKIE['EditTraining']; $EditSPMarketing = $_COOKIE['EditSPMarketing']; echo "EditSPMarketing: $EditSPMarketing<br>"; echo "EditTraining: $EditTraining<br>"; Output EditSPMarketing: EditTraining: 1 As you can see from the output, EditTraining displays '1' while EditSPMarketing seems to contain a null value. I have used echo to display the value of both columns before I set the cookie and EditSPMarketing definitely displays a value, but only one seems to get written to a cookie. What am I doing wrong here? Thank you, BillyB
×
×
  • 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.