当前位置: 首页>>代码示例>>PHP>>正文


PHP Session::delete方法代码示例

本文整理汇总了PHP中Session::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP Session::delete方法的具体用法?PHP Session::delete怎么用?PHP Session::delete使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Session的用法示例。


在下文中一共展示了Session::delete方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: country

 /**
  * Change country
  *
  * @param  string  $country
  */
 public function country($country)
 {
     if (in_array($country, Kohana::config('site.countries'))) {
         if ($this->session->get('country') == $country) {
             // Clear country if same as given
             $this->session->delete('country');
         } else {
             // Set country
             $this->session->set('country', $country);
         }
     }
     url::back();
 }
开发者ID:anqqa,项目名称:Anqh,代码行数:18,代码来源:set.php

示例2: logout

 public function logout()
 {
     // remove data from database
     $this->_db->delete('users_session', array('user_id', '=', $this->data()->id));
     Session::delete($this->_sessionName);
     Cookie::delete($this->_cookieName);
 }
开发者ID:huang53798584,项目名称:Login-Registration-System,代码行数:7,代码来源:User.php

示例3: session_destroy

 /**
  * Destroys the session, removing all data stored in this session and
  * removing any reference to this session.
  */
 public function session_destroy()
 {
     # Remove cookie
     remove_cookie($this->sign($this->session->id, $this->session->salt));
     # Remove session from database
     $this->session->delete();
 }
开发者ID:spockz,项目名称:Spockz-Library-for-CodeIgniter,代码行数:11,代码来源:Doctrine.php

示例4: action_profile

 public function action_profile()
 {
     $data = null;
     $data['user'] = Model_User::query()->related('user_providers')->where('id', static::$user_id)->get_one();
     $data['api_key'] = Auth::get('api_key');
     if (Input::Method() == 'POST') {
         $new_password = Input::Post('new_password');
         $current_password = Input::Post('current_password');
         if (empty($new_password) === false) {
             if (empty($current_password) === true) {
                 Session::set('error', 'You must enter your old password in first!');
                 $this->template->content = View::Forge('settings/profile', $data);
                 return;
             } else {
                 if (Auth::change_password($current_password, $new_password) === false) {
                     Session::set('error', 'Wrong Password');
                     $this->template->content = View::Forge('settings/profile', $data);
                     return;
                 } else {
                     Session::delete('current_password');
                 }
             }
         }
         // update the data for the current user
         try {
             Auth::update_user(array('email' => Input::Post('email'), 'fullname' => Input::Post('full_name')));
         } catch (Exception $e) {
             Session::set('error', $e->getMessage());
             $this->template->content = View::Forge('settings/profile', $data);
             return;
         }
         Session::set('success', 'Your profile has been updated');
     }
     $this->template->content = View::Forge('settings/profile', $data);
 }
开发者ID:aircross,项目名称:MeeLa-Premium-URL-Shortener,代码行数:35,代码来源:users.php

示例5: __construct

 function __construct()
 {
     if (isset($_COOKIE)) {
         Session::delete();
     }
     header('Location: /');
 }
开发者ID:jedaika,项目名称:Trainings,代码行数:7,代码来源:logout.php

示例6: action_index

 public function action_index()
 {
     // clear redirect referrer
     \Session::delete('submitted_redirect');
     // load language
     \Lang::load('index');
     // read flash message for display errors.
     $form_status = \Session::get_flash('form_status');
     if (isset($form_status['form_status']) && isset($form_status['form_status_message'])) {
         $output['form_status'] = $form_status['form_status'];
         $output['form_status_message'] = $form_status['form_status_message'];
     }
     unset($form_status);
     // get total accounts
     $output['total_accounts'] = \Model_Accounts::count();
     // <head> output ----------------------------------------------------------------------------------------------
     $output['page_title'] = $this->generateTitle(\Lang::get('admin_administrator_dashbord'));
     // <head> output ----------------------------------------------------------------------------------------------
     // breadcrumb -------------------------------------------------------------------------------------------------
     $page_breadcrumb = [];
     $page_breadcrumb[0] = ['name' => \Lang::get('admin_admin_home'), 'url' => \Uri::create('admin')];
     $output['page_breadcrumb'] = $page_breadcrumb;
     unset($page_breadcrumb);
     // breadcrumb -------------------------------------------------------------------------------------------------
     // the admin views or theme should follow this structure. (admin/templates/controller/method) and follow with _v in the end.
     return $this->generatePage('admin/templates/index/index_v', $output, false);
 }
开发者ID:rundiz,项目名称:fuel-start,代码行数:27,代码来源:index.php

示例7: action_list

 public function action_list()
 {
     $view = View::forge('admin/list');
     if (Session::get('status')) {
         $view->set_global('status', Session::get('status'));
         Session::delete('status');
     }
     if (\Input::post()) {
         if (Auth::delete_user(\Input::param('username'))) {
             Session::set('status', array('css' => 'success', 'msg' => 'ユーザ削除に成功しました'));
             Response::redirect('admin/list');
         } else {
             Session::set('status', array('css' => 'danger', 'msg' => 'ユーザ削除に失敗しました'));
             Response::redirect('admin/list');
         }
     }
     $list = DB::select('id', 'username', 'email', 'group')->from('users')->where('group', '!=', 100);
     $total = $list->execute()->count();
     $config = array('per_page' => 20, 'num_links' => 10, 'show_first' => true, 'show_last' => true, 'total_items' => $total, 'uri_segment' => 3);
     $pagination = Pagination::forge('mypagination', $config);
     $list->limit($pagination->per_page)->offset($pagination->offset);
     $result = $list->execute()->as_array();
     $view->set_global('list', $result);
     $view->set_global('pagination', $pagination);
     return $view;
 }
开发者ID:takawasitobi,项目名称:pembit,代码行数:26,代码来源:admin.php

示例8: logout

 /**
  * Log out a user by removing the related session variables.
  *
  * @param   boolean  $destroy  completely destroy the session
  * @return  boolean
  */
 public function logout($destroy = false)
 {
     // Delete the autologin cookie to prevent re-login
     if (cookie::get($this->config['cookie_name'])) {
         cookie::delete($this->config['cookie_name']);
     }
     // Logout 3rd party?
     if (FB::enabled() && Visitor::instance()->get_provider()) {
         $this->session->delete($this->config['session_key'] . '_provider');
         try {
             FB::instance()->expire_session();
         } catch (Exception $e) {
         }
     }
     // Destroy the session completely?
     if ($destroy === true) {
         $this->session->destroy();
     } else {
         // Remove the user from the session
         $this->session->delete($this->config['session_key']);
         // Regenerate session_id
         $this->session->regenerate();
     }
     // Double check
     return !$this->logged_in();
 }
开发者ID:anqqa,项目名称:Anqh,代码行数:32,代码来源:Visitor.php

示例9: deleteApplySeesion

 public static function deleteApplySeesion()
 {
     Session::delete('admission.unit');
     Session::delete('ssc.roll');
     Session::delete('ssc.session');
     Session::delete('ssc.res');
     Session::delete('ssc.py');
     Session::delete('ssc.board');
     Session::delete('ssc.group');
     Session::delete('ssc.gpa');
     Session::delete('hsc.roll');
     Session::delete('hsc.session');
     Session::delete('hsc.res');
     Session::delete('hsc.py');
     Session::delete('hsc.board');
     Session::delete('hsc.group');
     Session::delete('hsc.gpa');
     Session::delete('admission.name');
     Session::delete('admission.father.name');
     Session::delete('admission.mother.name');
     Session::delete('admission.gender');
     Session::delete('admission.nat');
     Session::delete('admission.preadress');
     Session::delete('admission.peradress');
     Session::delete('admission.contact');
     Session::delete('admission.dob');
     Session::delete('admission.photo');
 }
开发者ID:ahmed-dinar,项目名称:JUSTAS,代码行数:28,代码来源:miscellaneous.php

示例10: delete

    function delete()
    {
        $translator = new Translator();
        $user = new User();
        try {
            $id = array_shift($this->param);
            $user->disable($_SESSION['user_id']);
            Session::delete();
            echo <<<EOF
<div class="container">
   <div class="page-header">
        <h1>{$translator->User_updated}</h1>
      </div>
   <p class="lead">{$translator->User_updated_Desc}</p>
      <p >{$translator->Error_Backprofile}</p>
</div>
<script type="text/javascript">
window.location.href='/';
</script>

EOF;
        } catch (Exception $e) {
            echo <<<EOF
<div class="container">
   <div class="page-header">
        <h1>{$translator->User_error}</h1>
      </div>
   <p class="lead">{$translator->User_error_Desc}</p>
      <p >{$translator->Error_Backusers}</p>
</div>

EOF;
        }
    }
开发者ID:jedaika,项目名称:Trainings,代码行数:34,代码来源:profile.php

示例11: logout

 /**
  * Logout
  */
 public function logout($params)
 {
     Cookie::delete('login');
     Session::delete('username');
     header('Location: ' . $params['redirect']);
     exit;
 }
开发者ID:hugonicolas,项目名称:Site,代码行数:10,代码来源:User.php

示例12: callLoginAction

 private function callLoginAction($module = 'default')
 {
     Session::delete('user');
     require_once MODULE_PATH . $module . DS . 'controllers' . DS . 'LoginController.php';
     $indexController = new LoginController($this->_params);
     $indexController->indexAction();
 }
开发者ID:shimia90,项目名称:PHP-Training,代码行数:7,代码来源:Bootstrap.php

示例13: cerrar

 function cerrar()
 {
     Auth::destroy_identity();
     Session::delete("usuario_id");
     Session::delete("usuario_nombrecompleto");
     Router::redirect("login/index");
 }
开发者ID:criferlo,项目名称:empolab,代码行数:7,代码来源:login_controller.php

示例14: logout

 public function logout()
 {
     if (!is_null(Session::get('person'))) {
         Session::delete('person');
     }
     Router::redirect('/personal/');
 }
开发者ID:qconer,项目名称:php_kamgaz,代码行数:7,代码来源:personal.controller.php

示例15: clean

 /**
  * Método para limpiar los mensajes almacenados
  */
 public static function clean()
 {
     //Reinicio la variable de los mensajes
     self::$_contentMsj = array();
     //Elimino los almacenados en sesión
     Session::delete('mkc-messages');
 }
开发者ID:slrondon,项目名称:WispCenter,代码行数:10,代码来源:mkc_message.php


注:本文中的Session::delete方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。