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


PHP session::destroy方法代碼示例

本文整理匯總了PHP中session::destroy方法的典型用法代碼示例。如果您正苦於以下問題:PHP session::destroy方法的具體用法?PHP session::destroy怎麽用?PHP session::destroy使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在session的用法示例。


在下文中一共展示了session::destroy方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: perform

 function perform()
 {
     $chat_room_data =& fetch_mapped_by_url();
     session::destroy('last_message_ids');
     setcookie('chat_room_id', $chat_room_data['object_id'], time() + 365 * 24 * 3600);
     chat_user::enter_chat_room($chat_room_data['object_id']);
     return parent::perform();
 }
開發者ID:BackupTheBerlios,項目名稱:limb-svn,代碼行數:8,代碼來源:display_chat_room_action.class.php

示例2: logout

 public function logout()
 {
     session::destroy();
     if (isset($_COOKIE['user'])) {
         setcookie('user', "", 1, "/");
     }
     header('Location: ../index');
     exit;
 }
開發者ID:anjuna,項目名稱:nipple,代碼行數:9,代碼來源:dashboard.php

示例3: logout

 function logout()
 {
     session::destroy();
     header('location: ../login');
     /*
      * In Tutorial MVC, the header is
      *      header('location: ' . URL . 'login');
      */
     exit;
 }
開發者ID:saptharsh,項目名稱:Project-Management-App,代碼行數:10,代碼來源:dashboard.php

示例4: logout

 function logout()
 {
     session::destroy();
     if (session::get("isLoggedIn")) {
         $this->add_sys_msg("There was an error. You may still be logged in.");
     } else {
         $this->add_sys_msg("You have successfully logged out.");
     }
     $this->view->render("index/index");
 }
開發者ID:GlennWatt,項目名稱:personalWebSpace,代碼行數:10,代碼來源:login.php

示例5: __construct

 function __construct()
 {
     parent::__construct();
     auth::handleLogin();
     $type = session::get('role');
     if ($type != 'owner') {
         session::destroy();
         header('Location: ' . URL . 'index');
     }
 }
開發者ID:anjuna,項目名稱:nipple,代碼行數:10,代碼來源:user.php

示例6: __construct

 public function __construct()
 {
     parent::__construct();
     $logged = session::get("isLoggedIn");
     if ($logged == false) {
         session::destroy();
         echo $logged;
         header('location: ' . $this->base_url . '/index/error/You tried to access a page without logging in.');
         echo "fail";
         exit;
     }
     $this->view->js = array(VIEWS_DIR . 'dashboard/js/default.js');
 }
開發者ID:GlennWatt,項目名稱:personalWebSpace,代碼行數:13,代碼來源:dashboard.php

示例7: perform

 function perform(&$request, &$response)
 {
     $chat_room_data =& fetch_requested_object();
     session::destroy('last_message_ids');
     setcookie('chat_room_id', $chat_room_data['object_id'], time() + 365 * 24 * 3600);
     if ($chat_user_data = chat_user::get_chat_user_data()) {
         if ($chat_user_data['chat_room_id'] != $chat_room_data['object_id']) {
             chat_system::leave_chat_room($chat_user_data['id'], $chat_user_data['nickname'], $chat_user_data['chat_room_id']);
             chat_system::enter_chat_room($chat_user_data['id'], $chat_user_data['nickname'], $chat_room_data['object_id']);
         }
         $this->view->set('nickname', $chat_user_data['nickname']);
     }
     parent::perform(&$request, &$response);
 }
開發者ID:BackupTheBerlios,項目名稱:limb-svn,代碼行數:14,代碼來源:display_chat_room_action.class.php

示例8: set

 public static function set($type, $key, $value)
 {
     if (DEBUG) {
         $check = self::_get($type);
         if (!empty($check)) {
             self::$messages[$type] = $check;
             if (array_key_exists($key, self::$messages[$type])) {
                 unset(self::$messages[$type][$key]);
             }
             self::$messages[$type][$key] = $value;
         } else {
             self::$messages[$type][$key] = $value;
         }
         session::set("debug", self::$messages);
     } else {
         session::destroy("debug");
     }
 }
開發者ID:rajuthapa8086,項目名稱:SimpleMVC,代碼行數:18,代碼來源:debug.php

示例9: logout

 public static function logout()
 {
     return session::destroy();
 }
開發者ID:ThisNameWasFree,項目名稱:rude-univ,代碼行數:4,代碼來源:rude-template-session.php

示例10: logout

 public function logout()
 {
     if (session::item('spy_id')) {
         $oldID = session::item('user_id');
         $this->login(session::item('spy_id'), 0, array());
         session::delete('spy_id');
         router::redirect('cp/users/edit/' . $oldID);
     }
     $authID = session::item('auth_id');
     $userID = session::item('user_id');
     $ipaddress = substr(input::ipaddress(), 0, 15);
     $useragent = substr(input::useragent(), 0, 255);
     $this->deleteSession($authID, $userID, $ipaddress, $useragent);
     // Action hook
     hook::action('users/account/logout', $userID);
     cookie::delete('sessdata');
     session::set('auth_id', 0);
     session::set('user_id', 0);
     session::delete(array('auth_id', 'user_id'));
     session::destroy();
     session::initialize();
     return true;
 }
開發者ID:soremi,項目名稱:tutornavi,代碼行數:23,代碼來源:session.php

示例11: pageLogout

 public function pageLogout()
 {
     session::destroy();
     $this->redirect('login');
 }
開發者ID:laiello,項目名稱:zoop,代碼行數:5,代碼來源:ZoneDefault.php

示例12: close

 function close($id)
 {
     session::destroy('open' . $id);
 }
開發者ID:nibble-arts,項目名稱:openthesaurus,代碼行數:4,代碼來源:session.php

示例13: logout

 public static function logout()
 {
     session::destroy();
     $tokenExist = cookie::exists(TOKEN_NAME);
     if ($tokenExist) {
         $token = cookie::get(TOKEN_NAME);
         try {
             $db = new database(DBTYPE, DBHOST, DBNAME, DBUSER, DBPASS);
             $data = $db->select("users_session", "*", "token = '{$token}'", "fetch");
             $agent_id = $data['agent_id'];
             $db->delete("users_session", "token = '{$agent_id}'");
             cookie::delete(TOKEN_NAME);
         } catch (Exception $ex) {
             cookie::delete(TOKEN_NAME);
         }
     }
     redirect::to("login");
 }
開發者ID:kronxblue,項目名稱:1stg,代碼行數:18,代碼來源:user.php

示例14: logout

 function logout()
 {
     session::destroy();
     header('location: ' . URL . 'login');
     exit;
 }
開發者ID:vistazp,項目名稱:boatseller,代碼行數:6,代碼來源:dashboard.php

示例15: _session_destroy

 function _session_destroy()
 {
     session::destroy('chat_user_id');
     session::destroy('chat_user_data');
 }
開發者ID:BackupTheBerlios,項目名稱:limb-svn,代碼行數:5,代碼來源:chat_user.class.php


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