Skip to content

Commit 6ca6b7d

Browse files
committed
Note Session __isset and has() difference
1 parent d0a580a commit 6ca6b7d

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

system/Session/Session.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -628,16 +628,16 @@ public function __get(string $key)
628628
//--------------------------------------------------------------------
629629

630630
/**
631-
* Magic method to check for session variables
631+
* Magic method to check for session variables.
632+
* Different from has() in that it will validate 'session_id' as well.
633+
* Mostly used by internal PHP functions, users should stick to has()
632634
*
633635
* @param string $key Identifier of the session property to remove.
634636
*
635637
* @return bool
636638
*/
637639
public function __isset(string $key): bool
638640
{
639-
// Note: Keep this order the same, just in case somebody wants to
640-
// use 'session_id' as a session data key, for whatever reason
641641
return isset($_SESSION[$key]) || ($key === 'session_id');
642642
}
643643

0 commit comments

Comments
 (0)