title: set cookie with session value
body: <p>I cannot find in all the Q and A what i am looking for ( or i simply do not understand it (lol) ) so im hoping somebody can help me with this.</p>
  
  <p>I'm trying to make a "settings save" system based on cookies. <br>
  The settings are currently in a $_session[] and i would like to store them in a multidimensional array that goes into the cookie. <br>
  I figured that something like this would work but apparently i am missing something or i don't understand the way the cookie needs it arguments. </p>
  
  <p>My script looks like this:</p>
  
  <pre><code>$class1BP   =   $_SESSION["class1BP"];
  $class1BP1  =   $_SESSION["class1BP1"];
  $class1BP2  =   $_SESSION["class1BP2"];
  $class1BP3  =   $_SESSION["class1BP3"];
  $gedaanx    =   $_SESSION["gedaanx"];
  
  $array = array( $class1BP, $class1BP1, $class1BP2, $class1BP3, $gedaanx);
  setcookie('deel[1]', serialize($array);
  </code></pre>
  
  <p>So am i right that my array is wrong? Cause i don't know howto set cookies and never used it, any help would be appreciated.</p>