post->user && $input->post->pass) { $user = $sanitizer->username($input->post->user); $pass = $input->post->pass; if($session->login($user, $pass)) { $session->redirect($page->parent->httpUrl); } } $url1 = $sanitizer->name($input->urlSegment1); $resEmpresa = null; $q = "template=empresa, name={$url1}, limit=1"; if($url1) { if($pages->count($q)) { $resEmpresa = $pages->find($q)->first(); setcookie("w_empresa", $resEmpresa->name , time()+4000000, "/gestion/"); } else { $session->redirect($page->parent->httpUrl); setcookie("w_empresa", "", time()-3600); } } else { setcookie("w_empresa", "", time()-3600); unset($_COOKIE['w_empresa']); } ?>