title: Codeigniter Session losing data between pages
body: <p>I've been having trouble with my site where the session data gets ruined if a string containing something like <code>\\\'</code> is added to an array in the session data one page before. I'm trying to figure out ways to fix this.</p>
  
  <p>An Example of what happens:</p>
  
  <pre><code>    function testsession(){
          session_start();
          $breakingString['key'] = 'breaking code \\\'';  //Array containing string the that causes the break. It only breaks if in an array.
          $this-&gt;session-&gt;set_userdata('breakval', $breakingString);
          redirect('admin/testsession2');
      }
      function testsession2(){
          var_dump($this-&gt;session-&gt;userdata('breakval')); //returns false
          die;
      }
  </code></pre>
  
  <p>Is there any way to stop this bug from happening beyond encoding everything in base64?</p>