I have a class for working with the session, it inherits from an abstract class that has an array and a set() method that adds $key => $value data to the array. When I pass this array to $_SESSION by reference, the $_SESSION array is empty, why?
class SessionManager extends \AbstractSession
{
public function __construct()
{
session_start();
$this->data = &$_SESSION;
}
Call set method
$this->sessionManager->setKey($_GET['key'])
Result sessionManager array
array (size=1)
'key' => string '7831dc610922e7e0f84031b18b4ccc7d' (length=32)
and $_SESSION
array (size=0)
empty
Get help in solving the problem