I'm attempting to retrieve a cookie in index.php to record the value in a global_variable. I'd like to do it this way to avoid including PHP/plugin code on every template. Currently I have;
$assign_to_config['global_vars']['user_location'] = $this->EE->input->cookie('user_location');
However this throws the error;
Fatal error: Using $this when not in object context in /xx/xxx/xxx/index.php on line 28
Am I allowed to do this sort of thing?