public function heartBeat()
    {
        if (!$this->request->isAll(['ajax', 'post'])) {
            throw new MethodNotAllowedException();
        }

        $loginTime = $this->request->session()->check('loginTime') ? $this->request->session()->read('loginTime') : 0;
        $maxLoggedInTime = (int)Wasabi::setting('Core.Login.HeartBeat.max_login_time', 0) / 1000;
        $logoutTime = $loginTime + $maxLoggedInTime;

        if (time() <= $logoutTime) {
            $this->set([
                'status' => 200,
                '_serialize' => ['status']
            ]);
        } else {
            $this->Auth->logout();

            $this->set([
                'status' => 401,
                '_serialize' => ['status']
            ]);
        }
    }