Am I right assuming that session variables are available on the same page even if cookies are turned off?
I need a global array in my script (not across pages, only in the current script). When registering on top of the script:
$_SESSION['test'] = array('ok');
then $_SESSION[‘test’] will be ‘ok’ in every included file, function and class, even if cookies are disbled?
Thanks for advise.
If you want to have a global variable use
$GLOBALS. Of course even better would be to restructure your code and pass the required values as parameters.But yes, sessions are also possible without cookies. Then the session ID is not stored in a cookie, but passed in the URL. But why “abuse” sessions?
More information about variable scope.