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()); } }
/** * 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); } } } }
/** * 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); } }