title: Why does it give error after flashdata message?
body: <p>In Codeigniter, while I insert a new data, the website was freezing. I cannot click anywhere. I set flash data, and after I insert a new data, the website is locking. After refresh website, It gives this error:</p>
  
  <pre><code>A Database Error Occurred
  Error Number: HY000/2006
  
  MySQL server has gone away
  
  SELECT * FROM `customer` WHERE `cusId` = '1'
  
  Filename: controllers/Vehicles.php
  
  Line Number: 454
  </code></pre>
  
  <p>It gives more errors like that.</p>
  
  <p>My Controller:</p>
  
  <pre><code>............
  
  $insert = $this -&gt; db -&gt; insert("vehicles", $data);
  
              if ($insert) {
  
                  if($this-&gt;session-&gt;userdata('people_lang') == 'en') {$this-&gt;session-&gt;set_flashdata("success", "Vehicle has been Added Successfully!"); }
                  elseif($this-&gt;session-&gt;userdata('people_lang') == 'ar') {$this-&gt;session-&gt;set_flashdata("success", "تمت إضافة السيارة بنجاح!"); }
  
                  redirect(base_url("vehicles"));
  
              } else {
  
                  if($this-&gt;session-&gt;userdata('people_lang') == 'en') {$this-&gt;session-&gt;set_flashdata("error", "An Error Occurred during the Process."); }
                  elseif($this-&gt;session-&gt;userdata('people_lang') == 'ar') {$this-&gt;session-&gt;set_flashdata("error", "حدث خطأ أثناء العملية."); }
  
                  redirect(base_url("vehicles"));
  
              }
  </code></pre>