keep_flashdata() public method

Legacy CI_Session compatibility method
public keep_flashdata ( mixed $key ) : void
$key mixed Session data key(s)
return void
Example #1
0
 public function keep_flashdata($key = null)
 {
     if ($key !== null) {
         parent::keep_flashdata($key);
     } else {
         // An added feature: Keep all the flash data.
         parent::keep_flashdata($this->get_flash_keys());
     }
 }
Example #2
0
 /**
  * Keeps existing flashdata available to next request.
  *
  * @access    public
  * @param    string
  * @return    void
  */
 function keep_flashdata($key = '')
 {
     // Mark individual flashdata as 'new' to preserve it from _flashdata_sweep()
     if ($key) {
         parent::keep_flashdata($key);
     } else {
         $userdata = $this->all_userdata();
         foreach ($userdata as $name => $value) {
             $parts = explode(':old:', $name);
             if (is_array($parts) && count($parts) === 2) {
                 $new_name = $this->flashdata_key . ':new:' . $parts[1];
                 $this->set_userdata($new_name, $value);
                 $this->unset_userdata($name);
             }
         }
     }
 }
Example #3
0
 /**
  * Keeps existing flashdata available to next request.
  *
  * @access	public
  * @param	string
  * @return	void
  */
 function keep_flashdata($key)
 {
     if ($this->is_custom_session) {
         return $this->session_driver->keep_flashdata($key);
     } else {
         return parent::keep_flashdata($key);
     }
 }