當前位置: 首頁>>代碼示例>>PHP>>正文


PHP session_destroy函數代碼示例

本文整理匯總了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;
 }
開發者ID:edvaldoszy,項目名稱:sistema-login-php-oop,代碼行數:10,代碼來源:Sessao.php

示例2: destroy

 public function destroy()
 {
     foreach ($_SESSION as $var => $val) {
         $_SESSION[$var] = null;
     }
     session_destroy();
 }
開發者ID:netconstructor,項目名稱:sugarcrm_dev,代碼行數:7,代碼來源:SugarSession.php

示例3: destroy_sess

 public function destroy_sess()
 {
     // Emtpy out the sessions array
     // then destroy the whole session
     $this->my_sess = array();
     session_destroy();
 }
開發者ID:paarma,項目名稱:BibliotecaFupWeb,代碼行數:7,代碼來源:Simple_sessions.php

示例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();
 }
開發者ID:staabm,項目名稱:redaxo,代碼行數:7,代碼來源:backend_login_test.php

示例5: logout

 /**
  * Handles user logout.
  */
 public function logout()
 {
     $_SESSION = array();
     session_destroy();
     header('Location: ' . PHPCI_URL);
     die;
 }
開發者ID:kukupigs,項目名稱:PHPCI,代碼行數:10,代碼來源:SessionController.php

示例6: logout

 public function logout()
 {
     if (isset($_SESSION['username'])) {
         session_destroy();
         redirect(base_url());
     }
 }
開發者ID:TUPM-BSCS,項目名稱:pinasikat,代碼行數:7,代碼來源:Pinasikat.php

示例7: stop

 public static function stop()
 {
     foreach ($_SESSION as $k => $v) {
         unset($_SESSION[$k]);
     }
     session_destroy();
 }
開發者ID:tigar-bilderski,項目名稱:repozaframework,代碼行數:7,代碼來源:Session.php

示例8: reset

 /**
  * Destroy sessions
  */
 public static function reset()
 {
     if (!Session::checkStart()) {
         session_start();
     }
     session_destroy();
 }
開發者ID:quenti77,項目名稱:easyhq,代碼行數:10,代碼來源:Session.php

示例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;
}
開發者ID:efux,項目名稱:mailcow,代碼行數:34,代碼來源:functions.inc.php

示例10: logof

function logof()
{
    session_start();
    $_SESSION['id'] = '';
    session_destroy();
    echo '<script language= "JavaScript">location.href="' . EXTERNAL_ROOT_PORTAL . '/index.php";</script>';
}
開發者ID:hexti,項目名稱:casamento,代碼行數:7,代碼來源:metodos.php

示例11: logout

 public function logout()
 {
     unset($_SESSION['FE']);
     $this->login = false;
     $this->level = 0;
     session_destroy();
 }
開發者ID:seekwhencer,項目名稱:Playlist-Automation,代碼行數:7,代碼來源:User.php

示例12: destroy

 public static function destroy()
 {
     if (self::$_sessionStarted == true) {
         session_unset();
         session_destroy();
     }
 }
開發者ID:viralsolani,項目名稱:yapf,代碼行數:7,代碼來源:session.php

示例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 '';
}
開發者ID:AurelienAubert,項目名稱:Stage_Apsaroke,代碼行數:35,代碼來源:verif_login_password.php

示例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();
         }
     }
 }
開發者ID:AntonGreen,項目名稱:SeniorProjectPokeGo,代碼行數:29,代碼來源:CreateNewUserModel.class.php

示例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');
 }
開發者ID:emilev90,項目名稱:intekenbord,代碼行數:7,代碼來源:login.class.php


注:本文中的session_destroy函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。