本文整理汇总了PHP中session_destroy函数的典型用法代码示例。如果您正苦于以下问题:PHP session_destroy函数的具体用法?PHP session_destroy怎么用?PHP session_destroy使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了session_destroy函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: destruir
/**
* @return boolean
*/
public function destruir()
{
if (isset($_SESSION)) {
return session_destroy();
}
return false;
}
示例2: destroy
public function destroy()
{
foreach ($_SESSION as $var => $val) {
$_SESSION[$var] = null;
}
session_destroy();
}
示例3: destroy_sess
public function destroy_sess()
{
// Emtpy out the sessions array
// then destroy the whole session
$this->my_sess = array();
session_destroy();
}
示例4: tearDown
public function tearDown()
{
$deleteuser = rex_sql::factory();
$deleteuser->setQuery('DELETE FROM ' . rex::getTablePrefix() . "user WHERE login = '" . $this->login . "' LIMIT 1");
// make sure we don't mess up the global scope
session_destroy();
}
示例5: logout
/**
* Handles user logout.
*/
public function logout()
{
$_SESSION = array();
session_destroy();
header('Location: ' . PHPCI_URL);
die;
}
示例6: logout
public function logout()
{
if (isset($_SESSION['username'])) {
session_destroy();
redirect(base_url());
}
}
示例7: stop
public static function stop()
{
foreach ($_SESSION as $k => $v) {
unset($_SESSION[$k]);
}
session_destroy();
}
示例8: reset
/**
* Destroy sessions
*/
public static function reset()
{
if (!Session::checkStart()) {
session_start();
}
session_destroy();
}
示例9: check_login
function check_login($link, $user, $pass)
{
if (!ctype_alnum(str_replace(array('@', '.', '-'), '', $user))) {
return false;
}
$pass = escapeshellcmd($pass);
$result = mysqli_query($link, "SELECT password FROM admin WHERE superadmin='1' AND username='{$user}'");
while ($row = mysqli_fetch_array($result, MYSQL_NUM)) {
$row = "'" . $row[0] . "'";
if (strpos(shell_exec("echo {$pass} | doveadm pw -s SHA512-CRYPT -t {$row}"), "verified") !== false) {
return "admin";
}
}
$result = mysqli_query($link, "SELECT password FROM admin WHERE superadmin='0' AND active='1' AND username='{$user}'");
while ($row = mysqli_fetch_array($result, MYSQL_NUM)) {
$row = "'" . $row[0] . "'";
if (strpos(shell_exec("echo {$pass} | doveadm pw -s SHA512-CRYPT -t {$row}"), "verified") !== false) {
return "domainadmin";
}
}
$result = mysqli_query($link, "SELECT password FROM mailbox WHERE active='1' AND username='{$user}'");
while ($row = mysqli_fetch_array($result, MYSQL_NUM)) {
$row = "'" . $row[0] . "'";
if (strpos(shell_exec("echo {$pass} | doveadm pw -s SHA512-CRYPT -t {$row}"), "verified") !== false) {
return "user";
}
}
session_unset();
session_destroy();
session_write_close();
setcookie(session_name(), '', 0, '/');
sleep(1);
return false;
}
示例10: logof
function logof()
{
session_start();
$_SESSION['id'] = '';
session_destroy();
echo '<script language= "JavaScript">location.href="' . EXTERNAL_ROOT_PORTAL . '/index.php";</script>';
}
示例11: logout
public function logout()
{
unset($_SESSION['FE']);
$this->login = false;
$this->level = 0;
session_destroy();
}
示例12: destroy
public static function destroy()
{
if (self::$_sessionStarted == true) {
session_unset();
session_destroy();
}
}
示例13: connexion
function connexion()
{
try {
//si le login et le mdp existent
if (isset($_POST["login"]) && isset($_POST["mdp"])) {
// récupération sécurisée du mdp et du login dans des variables
$login = htmlspecialchars(addslashes(trim(strtoupper($_POST['login']))));
$password = htmlspecialchars(addslashes(trim(md5($_POST['mdp']))));
$_SESSION['login'] = $login;
$query = "SELECT COL_NO, TAU_NO, COL_NOM, COL_PRENOM, COL_MNEMONIC FROM COLLABORATEUR WHERE COL_MNEMONIC='" . $login . "' AND (COL_PASSWORD='" . $password . "' OR COL_PASS_ALL='" . $password . "')";
$result = $GLOBALS['connexion']->query($query);
if (mysqli_num_rows($result) == 1) {
$connection = true;
$row = $result->fetch_assoc();
$_SESSION['col_id'] = $row['COL_NO'];
$_SESSION['accreditation'] = $row['TAU_NO'];
$_SESSION['nom'] = $row['COL_NOM'];
$_SESSION['prenom'] = $row['COL_PRENOM'];
$_SESSION['mnemonic'] = $row['COL_MNEMONIC'];
header("Location: accueil.php");
//header ("Location: accueil_bloque.php");
} else {
$_SESSION = array();
session_destroy();
return '<script>alert("Identifiant et/ou mot de passe incorrect");</script>';
}
} else {
$connection = false;
}
} catch (Exception $e) {
// message en cas d'erreur
die('Erreur : ' . $e->getMessage());
}
return '';
}
示例14: process
public function process()
{
session_start();
$mysql = new pokeGOMySQL();
// check for name being passed in
if (isset($this->inData['goBack'])) {
header("location:LoginController.php");
} else {
if (isset($this->inData['submitUser'])) {
header("location:CreateNewUserController.php");
$this->myNEWUserName = $this->inData['myNEWUserName'];
$this->myNEWPassword = $this->inData['myNEWPassword'];
//$this->myNEWCONFIRMPassword = $this->inData['myNEWCONFIRMPassword'];
//$_SESSION['myNEWCONFIRMPassword'] = $this->inData['myNEWCONFIRMPassword'];
$_SESSION['myNEWPassword'] = $this->inData['myNEWPassword'];
$_SESSION['myNEWUserName'] = $this->inData['myNEWUserName'];
//$this->outData['myNEWCONFIRMPassword'] = $_SESSION['myNEWCONFIRMPassword'];
$this->outData['myNEWPassword'] = $_SESSION['myNEWPassword'];
$this->outData['myNEWUserName'] = $_SESSION['myNEWUserName'];
$this->addUser($mysql);
} else {
// initialize a new session array, this is if the page is refreshed
session_destroy();
//if the session_destroy does not destroy the session
//this will force all $_SESSION into a new array
$_SESSION = array();
}
}
}
示例15: logOut
function logOut()
{
session_destroy();
echo "<div class='alert alert-warning' role='alert'>Je bent nu uitgelogd.</div>";
$index = new Index();
$index->redirect('index.php');
}