diff --git a/system/Session/Session.php b/system/Session/Session.php index 3494b88993f2..d925bd7ab5e8 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; }