diff --git a/system/Session/Session.php b/system/Session/Session.php index 8e845462065b..4c6f39ec9c0e 100644 --- a/system/Session/Session.php +++ b/system/Session/Session.php @@ -723,9 +723,9 @@ public function markAsFlashdata($key): bool { if (is_array($key)) { - for ($i = 0, $c = count($key); $i < $c; $i ++) + foreach ($key as $sessionKey) { - if (! isset($_SESSION[$key[$i]])) + if (! isset($_SESSION[$sessionKey])) { return false; }