1
0
mirror of https://github.com/beestat/app.git synced 2025-05-24 02:14:03 -04:00
beestat/index.php
Jon Ziebell 48baf93f25 Fixed #161 - Reload loop after migration from beestat.io/dashboard to app.beestat.io
This is a temporary change to address the reload loop due to bad cookies from beestat.io
2019-10-20 23:00:09 -04:00

49 lines
951 B
PHP

<?php
require 'api/cora/setting.php';
$setting = cora\setting::get_instance();
// Dump you straight into the demo.
if($setting->is_demo() === true) {
setcookie(
'session_key',
'd31d3ef451fe65885928e5e1bdf4af321f702009',
4294967295,
'/',
null,
$setting->get('force_ssl'),
true
);
}
// var_dump($_COOKIE);
// Skip this page entirely if you're logged in.
// if(isset($_COOKIE['session_key']) === true) {
if(preg_match('/app\.beestat\.io/', $_SERVER['HTTP_HOST']) !== 0) {
require 'app.php';
} else {
// When on regular beestat.io, delete these cookies.
setcookie(
'session_key',
'',
time() - 86400,
'/',
'',
true,
true
);
setcookie(
'session_user_id',
'',
time() - 86400,
'/',
'',
true,
true
);
require 'www.php';
}