At the top of my index page a set a session using:
$_SESSION['language'] = 'english';
and when I echo $_SESSION['language'] it echoes 'english', However the session value is not readable inside a PHP class, why is that?
At the top of my index page a set a session using:
$_SESSION['language'] = 'english';
and when I echo $_SESSION['language'] it echoes 'english', However the session value is not readable inside a PHP class, why is that?
You must call session_start()
before you have access to the $_SESSION
super global
PHP session_start() docs