public function postLogin() { if ($_POST['username'] == 'test' && $_POST['password'] == 'test') { $_SESSION['personId'] = 1; session::saveChangesUnsafe(); $this->redirect('protected'); } $this->redirect('login/bad'); }
public function postLogin($p, $z) { $user = DbObject::_findOne('Person', array('username' => $_POST['username'], 'password' => $_POST['password'])); if ($user) { $_SESSION['personId'] = $user->id; session::saveChangesUnsafe(); } Redirect($_SERVER['HTTP_REFERER']); }
public static function auth($username, $password) { $id = SqlFetchCell("select id from person where username = :username and password = :password", array('username' => $username, 'password' => $password)); if (!$id) { return false; } $_SESSION['personId'] = $id; session::saveChangesUnsafe(); return true; }
public function login() { $_SESSION['personId'] = $this->id; session::saveChangesUnsafe(); }
function setLoggedInId($id) { $_SESSION['personId'] = $id; session::saveChangesUnsafe(); }
function pageAfter() { $_SESSION['afterId'] += 1; session::saveChangesUnsafe(); echo_r($_SESSION); }