summaryrefslogtreecommitdiffstats
path: root/system/libraries/Session/Session.php
diff options
context:
space:
mode:
authordchill42 <dchill42@gmail.com>2012-07-23 16:53:47 +0200
committerdchill42 <dchill42@gmail.com>2012-07-23 16:53:47 +0200
commitc5079de78e5141330c07e990811ef15e998e95aa (patch)
tree0f39d8c4fc7614246fc185810bfeaa7fad88a33a /system/libraries/Session/Session.php
parent00fcb545109d4e61bc14e403ec828749c34a54b3 (diff)
parentede49ba66b127535f3430e20aac72ceed2c4611a (diff)
Merge branch develop of github.com:/EllisLab/CodeIgniter into session
Diffstat (limited to 'system/libraries/Session/Session.php')
-rwxr-xr-xsystem/libraries/Session/Session.php25
1 files changed, 23 insertions, 2 deletions
diff --git a/system/libraries/Session/Session.php b/system/libraries/Session/Session.php
index 7c340ccca..94fb4b10a 100755
--- a/system/libraries/Session/Session.php
+++ b/system/libraries/Session/Session.php
@@ -197,6 +197,27 @@ class CI_Session extends CI_Driver_Library {
}
/**
+ * Fetch all flashdata
+ *
+ * @return array Flash data array
+ */
+ public function all_flashdata()
+ {
+ $out = array();
+
+ // loop through all userdata
+ foreach ($this->all_userdata() as $key => $val)
+ {
+ // if it contains flashdata, add it
+ if (strpos($key, self::FLASHDATA_KEY.self::FLASHDATA_OLD) !== FALSE)
+ {
+ $out[$key] = $val;
+ }
+ }
+ return $out;
+ }
+
+ /**
* Add or change data in the "userdata" array
*
* @param mixed Item name or array of items
@@ -297,8 +318,8 @@ class CI_Session extends CI_Driver_Library {
*/
public function keep_flashdata($key)
{
- // 'old' flashdata gets removed. Here we mark all
- // flashdata as 'new' to preserve it from _flashdata_sweep()
+ // 'old' flashdata gets removed. Here we mark all flashdata as 'new' to preserve it from _flashdata_sweep()
+ // Note the function will return NULL if the $key provided cannot be found
$old_flashdata_key = self::FLASHDATA_KEY.self::FLASHDATA_OLD.$key;
$value = $this->userdata($old_flashdata_key);