I've done some testing with $_SESSION and $_COOKIE because I they weren't working as I expected. I'd like to know why these lines of code behave differently.
$_SESSION[1] = 'foo'; // Does not work because of the integer
$_COOKIE[1] = 'bar'; // Works
$_SESSION['foo bar'] = 'foo'; // Works with the space
$_COOKIE['foo bar'] = 'bar'; // Does not work
I would have thought $_SESSION and $_COOKIE would be identical, other than being server side vs. client side. Are there any other differences between the two?