is_demo() === true) { setcookie( 'session_key', 'd31d3ef451fe65885928e5e1bdf4af321f702009', 4294967295, '/', 'demo.beestat.io', $setting->get('force_ssl'), true ); // Just so I can make some simpler assumptions in app.php since the // superglobal is not updated when calling setcookie(). $_COOKIE['session_key'] = 'd31d3ef451fe65885928e5e1bdf4af321f702009'; } // If you're not logged in, just take you directly to the ecobee login page. if(isset($_COOKIE['session_key']) === false) { header('Location: https://' . $_SERVER['HTTP_HOST'] . '/api/?resource=ecobee&method=authorize&arguments={}&api_key=' . $setting->get('beestat_api_key_local')); die(); } ?>