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


PHP Session::remove方法代码示例

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


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

示例1: testRemove

 /**
  * @covers $this->object->remove
  * @todo   Implement testRemove().
  */
 public function testRemove()
 {
     session_start();
     $_SESSION['test'] = 'TEST';
     $this->object->remove('test');
     $this->assertEquals(false, isset($_SESSION['test']));
 }
开发者ID:PermeAgility,项目名称:FrameworkBenchmarks,代码行数:11,代码来源:sessionTest.php

示例2: home

 /**
  * Add apartment page
  * @return \Illuminate\View\View
  */
 public function home()
 {
     $apartment = new ListApartment();
     //Hard code
     $apartment->username = Auth::user()->username;
     // Get all district
     $district = ListDistrict::lists('name_district', 'id_district');
     // Get all province
     $province = ListProvice::lists('name_province', 'id_province');
     // Get all project
     $projects = ListProject::lists('name', 'ID');
     //Get project
     $project_id = Input::get('project');
     $apartment->project = $project_id;
     // Get all furniture
     $furnitures = Furniture::lists('name', 'ID');
     // Get all management company
     $directions = Direction::lists('name', 'ID');
     // Get all floor material
     $floor_materials = FloorMaterial::lists('name', 'ID');
     // Clear Session
     for ($i = -2; $i < 8; $i++) {
         if (Session::has("image[{$i}]")) {
             Session::remove("image[{$i}]");
         }
     }
     return View::make('pages.apartment', compact('apartment', 'district', 'province', 'projects', 'project_id', 'furnitures', 'directions', 'floor_materials'));
 }
开发者ID:Nguyenkain,项目名称:HomeTo,代码行数:32,代码来源:ApartmentController.php

示例3: manager

 public function manager()
 {
     if (Request::segment(2) == 'search') {
         $input = Session::get('search') && !Input::get('search_category') ? Session::get('search') : Input::only(array('search_category', 'search_keyword'));
         switch ($input['search_category']) {
             case '0':
                 return Redirect::to('managers');
                 break;
             case 'owner':
                 $users = User::where('status', 3)->whereHas('domain', function ($q) {
                     $q->whereHas('user', function ($q) {
                         $q->where('username', 'like', '%' . Input::get('search_keyword') . '%');
                     });
                 })->get();
                 break;
             case 'name':
                 $users = User::where('status', 3)->whereHas('profile', function ($q) {
                     $q->where(function ($q) {
                         $q->where('first_name', 'like', '%' . Input::get('search_keyword') . '%');
                         $q->orWhere('last_name', 'like', '%' . Input::get('search_keyword') . '%');
                     });
                 })->get();
                 break;
             default:
                 $users = User::where('status', 3)->where($input['search_category'], 'LIKE', '%' . $input['search_keyword'] . '%')->get();
                 break;
         }
         Session::set('search', $input);
     } else {
         Session::remove('search');
         $input = array('search_category' => '', 'search_keyword' => '');
         $users = User::where('status', 3)->get();
     }
     return View::make('user_management.index')->with('users', $users)->with('selected', $input);
 }
开发者ID:digideskio,项目名称:voip-id,代码行数:35,代码来源:UserManagementController.php

示例4: getIndex

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function getIndex()
 {
     if (Request::segment(2) == 'search') {
         $input = Session::get('search') && !Input::get('search_category') ? Session::get('search') : Input::only(array('search_category', 'search_keyword'));
         switch ($input['search_category']) {
             case '0':
                 return Redirect::to('gateway');
                 break;
             case 'owner':
                 $gateways = Gateway::whereHas('user', function ($q) {
                     $q->where('username', 'LIKE', '%' . Input::get('search_keyword') . '%');
                 })->get();
                 break;
             default:
                 if (Auth::user()->status == 2) {
                     $gateways = Gateway::where($input['search_category'], 'LIKE', '%' . $input['search_keyword'] . '%')->get();
                 } else {
                     $gateways = Gateway::where('user_id', Auth::user()->id)->where($input['search_category'], 'LIKE', '%' . $input['search_keyword'] . '%')->get();
                 }
                 break;
         }
         Session::set('search', $input);
     } else {
         Session::remove('search');
         $input = array('search_category' => '', 'search_keyword' => '');
         $gateways = Auth::user()->status == 2 ? Gateway::all() : Gateway::where('user_id', Auth::user()->id)->get();
     }
     return View::make('gateway.index')->with('gateways', $gateways)->with('selected', $input);
 }
开发者ID:digideskio,项目名称:voip-id,代码行数:34,代码来源:GatewayController.php

示例5: logoutAction

 public function logoutAction($key = 'user')
 {
     Session::remove($key);
     Session::destroy();
     Session::setFlash(__t('you_logout'));
     $this->redirect("/");
 }
开发者ID:artemkuchma,项目名称:php_academy_site2,代码行数:7,代码来源:SecurityController.php

示例6: tokenValidate

 /**
  * tokenチェック
  */
 protected function tokenValidate($name = 'token')
 {
     $request = Request::getInstance();
     $value = $request->get($name, '');
     $value = mb_convert_kana($value, 'n');
     return Session::remove($name) == $value ? null : __('Token authentication is invalid');
 }
开发者ID:nokatsur,项目名称:blog,代码行数:10,代码来源:app_controller.php

示例7: LA_Session_Clear

function LA_Session_Clear($key)
{
    // clear persisted value for the given string key
    if (\Session::has($key)) {
        \Session::remove($key);
    }
}
开发者ID:captcha-com,项目名称:laravel-captcha,代码行数:7,代码来源:CaptchaConfigDefaults.php

示例8: remove

	function remove($key = null) {
		if ($key == null) {
			$key = get_class($this);
		} else {
			$key = get_class($this).".$key";
		}
		Session::remove(ACTION_SCOPE, $key);
	}
开发者ID:reekoheek,项目名称:php-fw,代码行数:8,代码来源:BaseAction.php

示例9: verify

 public static function verify($key = null, $debug = false)
 {
     global $global;
     $result = Session::get('_token.' . $global['name']) === ($key == null ? Form::get('token', 'no') : $key);
     if (!$debug) {
         Session::remove('_token.' . $global['name']);
     }
     return $result;
 }
开发者ID:cpellens,项目名称:Old-PHP-Framework,代码行数:9,代码来源:token.php

示例10: get

 public static function get($key)
 {
     $prefixkey = self::$prefix . $key;
     if (Session::exists($prefixkey)) {
         $value = Session::get($prefixkey);
         Session::remove($prefixkey);
         return '<div class="alert alert-' . $key . '">' . $value . '</div>';
     }
 }
开发者ID:Kocal,项目名称:Loytonia-webchat,代码行数:9,代码来源:Flash.php

示例11: _validation_error

 protected function _validation_error($obj)
 {
     $validationErrors = is_subclass_of($obj, 'LaravelBook\\Ardent\\Ardent') ? $obj->validationErrors : $obj;
     if (Request::ajax()) {
         return Response::json($validationErrors, 400);
     }
     Session::remove('_old_input');
     return Redirect::back()->withErrors($validationErrors)->with('notification:danger', $this->validation_error_message);
 }
开发者ID:k4ml,项目名称:laravel-base,代码行数:9,代码来源:BaseController.php

示例12: tryLogout

 public static function tryLogout()
 {
     if (Session::has("user")) {
         Session::remove("user");
         return true;
     } else {
         return false;
     }
 }
开发者ID:h4kbas,项目名称:Just,代码行数:9,代码来源:auth.class.php

示例13: authenticate

 public function authenticate()
 {
     //@todo sanitize post input
     $post = $this->post();
     $this->__ldap_connect();
     if (empty($post['uName']) || empty($post['uPassword'])) {
         throw new Exception(t('Please provide both username and password.'));
     }
     $domain = trim(Config::get('auth.ldap.ldapdomain'));
     $uName = $post['uName'];
     if (strlen($domain)) {
         $ldapLoginuName = Config::get('auth.ldap.ldapdomain') . '\\' . $uName;
     }
     $uPassword = $post['uPassword'];
     if (!@ldap_bind($this->connection, $ldapLoginuName, $uPassword)) {
         throw new \Exception(t('Invalid username or password.'));
     } else {
         \Session::remove('accessEntities');
         $uID = $this->getUserByLdapUser($uName);
         if ($uID) {
             // ldap user has been bound to a c5 user
             $ui = UserInfo::getByID($uID);
         }
         if (!is_object($ui) || !$ui instanceof UserInfo || $ui->isError()) {
             // user needs to be created
             $user = $this->createUser($uName, $uName . "@" . $domain . '.us');
             // @TODO email is a total hack right now - fix it.
         } else {
             $user = \User::loginByUserID($ui->getUserID());
         }
         if (is_object($user) && $user->isError()) {
             switch ($user->getError()) {
                 case USER_SESSION_EXPIRED:
                     throw new \Exception(t('Your session has expired. Please sign in again.'));
                     break;
                 case USER_NON_VALIDATED:
                     throw new \Exception(t('This account has not yet been validated. Please check the email associated with this account and follow the link it contains.'));
                     break;
                 case USER_INVALID:
                     if (Config::get('concrete.user.registration.email_registration')) {
                         throw new \Exception(t('Invalid email address or password.'));
                     } else {
                         throw new \Exception(t('Invalid username or password.'));
                     }
                     break;
                 case USER_INACTIVE:
                     throw new \Exception(t('This user is inactive. Please contact the helpdesk regarding this account.'));
                     break;
             }
         }
     }
     if ($post['uMaintainLogin']) {
         $user->setAuthTypeCookie('ldap');
     }
     $this->completeAuthentication($user);
 }
开发者ID:tylerryan,项目名称:concrete-5-7-ldap-authentication,代码行数:56,代码来源:controller.php

示例14: isValid

 public function isValid()
 {
     $validator = Validator::make($this->attributesToArray(), $this->rules);
     if ($validator->fails()) {
         Session::remove('messages');
         foreach ($validator->getMessageBag()->getMessages() as $message) {
             Session::push('messages', $message[0]);
         }
         //			debug(Session::get('messages')); exit;
         return false;
     }
     return true;
 }
开发者ID:Clare-E-Rich,项目名称:DECO7381_MoneyLink_IndividualComponant,代码行数:13,代码来源:Contract.php

示例15: saveStory

 /**
  * This will save the access story to the database
  */
 public function saveStory()
 {
     // set the end time
     $this->getSessionManager()->setEndTime();
     // calculate the memory usage
     $this->getSessionManager()->setMemoryUsage();
     // get the collected data
     $aData = $this->getSessionManager()->getCollectedData();
     $aData = array_merge($aData, ['response_time' => $this->getSessionManager()->getTimeTaken(), 'memory_usage' => $this->getSessionManager()->getMemoryUsage()]);
     // save the access history now
     AccessStoryModel::create($aData);
     // remove the session, so that it would always be unique across each request
     \Session::remove(Reader::getSessionKeyName());
 }
开发者ID:samcrosoft,项目名称:accesstory,代码行数:17,代码来源:AccessStory.php


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