当前位置: 首页>>代码示例>>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;未经允许,请勿转载。