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


PHP session::forget方法代碼示例

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


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

示例1: handle

 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     if (!$this->session->has('lastActivityTime')) {
         $this->session->put('lastActivityTime', time());
     } else {
         if (time() - $this->session->get('lastActivityTime') > $this->getTimeOut()) {
             $this->session->forget('lastActivityTime');
             Auth::logout();
             return redirect($this->getRedirectUrl())->with([$this->getSessionLabel() => 'You have been inactive for ' . $this->timeout / 60 . ' minutes ago.']);
         }
     }
     $this->session->put('lastActivityTime', time());
     return $next($request);
 }
開發者ID:pnagaraju25,項目名稱:laravel-sessiontimeout,代碼行數:21,代碼來源:SessionTimeout.php

示例2: handleFilterRequest

 /**
  * Handle filter request for creating propel query.
  *
  * @param  array  $filter_request
  * @param  string   $filter_name
  * @return bool
  */
 public function handleFilterRequest($filter_request, $filter_name)
 {
     if (session($filter_name)) {
         $filter = session($filter_name);
     } else {
         $filter = array();
     }
     if (isset($filter_request['reset'])) {
         session::forget($filter_name);
         $filter = array();
         $this->createQuery($filter, false);
     } else {
         if (isset($filter_request['search'])) {
             $this->createQuery($filter_request, true);
         } else {
             $this->createQuery($filter, false);
         }
     }
 }
開發者ID:nstojanovickg,項目名稱:diplomski,代碼行數:26,代碼來源:BaseList.php

示例3: ReturningCustomerForm

 /**
  * Returning Customer Form Processing. (This will redirect them back to the front end, which should have all of there information!
  */
 public function ReturningCustomerForm()
 {
     $lastname = Input::get('lastname');
     $email = Input::get('email');
     $capche_key = '6LdI9wATAAAAANT_6rPnIaMpVXhAGO8AhOu7H_eV';
     $capche_secret = '6LdI9wATAAAAAGAb9tN6ugLnTWFfHUtb3XCc8YdQ';
     $response = Input::get('g-recaptcha-response');
     //check if the y are correct
     $results = file_get_contents('https://www.google.com/recaptcha/api/siteverify?secret=' . $capche_secret . '&response=' . $response . '&remoteip=' . $_SERVER['REMOTE_ADDR']);
     $response = json_decode($results);
     if (isset($response->success) && $response->success) {
         $solved_capache = true;
     } else {
         $messages = new Illuminate\Support\MessageBag();
         $messages->add('You must prove you are human ', " <b>Capache Error</b>");
         Session::flash('ShowReturnPanel', true);
         Session::flash('SearchError', true);
         return Redirect::to('/')->withErrors($messages);
     }
     $this->TranslateOrderFromStatus("false", $ordered_cpn, $ordered_repayment_promisory_note, $ordered_pslf, $ordered_forebearance);
     Session::put('ordered_cpn', $ordered_cpn);
     Session::put('ordered_repayment_promisory_note', $ordered_repayment_promisory_note);
     Session::put('ordered_pslf', $ordered_pslf);
     Session::put('ordered_forebearance', $ordered_forebearance);
     session::forget('Step3Completed');
     //		$ssn = str_replace('-', '', $ssn); // remove any dashes.
     //		$ssn = substr($ssn,0,3) .'-'.substr($ssn,3,2).'-'.substr($ssn,5);
     //find out if they have anything matching.
     //		$search = $this->leadtracapi->FindClientByLastNameAndSSN($lastname, $ssn);
     $search = $this->leadtracapi->FindClientByLastNameAndEmail($lastname, $email);
     if (!$search) {
         //Show the page & add errors!
         Session::flash('ShowReturnPanel', true);
         Session::flash('SearchError', true);
         Session::forget('fileNumber');
     } else {
         Session::put('fileNumber', $search);
         // lets see if they are upgrading/updating their profile (see if they have paid for anything.)
         $client = $this->leadtracapi->GetClient($search, array('FirstName', 'LastName', 'Loan_Program'));
         $upgrade = array('100% Payments Received', 'Process Payments');
         session::forget('Step3Completed');
         $this->TranslateOrderFromStatus($client->Status->Sales, $ordered_cpn, $ordered_repayment_promisory_note, $ordered_pslf, $ordered_forebearance);
         Session::put('ordered_cpn', $ordered_cpn);
         Session::put('ordered_repayment_promisory_note', $ordered_repayment_promisory_note);
         Session::put('ordered_pslf', $ordered_pslf);
         Session::put('ordered_forebearance', $ordered_forebearance);
         if (isset($client->Status->Accounting) && in_array($client->Status->Accounting, $upgrade)) {
             Session::put('ClientUpgrade', true);
         } else {
             Session::put('ClientUpgrade', false);
         }
     }
     return Redirect::to('/');
 }
開發者ID:jordone,項目名稱:diyonline,代碼行數:57,代碼來源:ClientController.php

示例4: ReturningCustomerForm

 /**
  * Returning Customer Form Processing. (This will redirect them back to the front end, which should have all of there information!
  */
 public function ReturningCustomerForm()
 {
     $lastname = Input::get('lastname');
     $email = Input::get('email');
     $capche_key = '6LdI9wATAAAAANT_6rPnIaMpVXhAGO8AhOu7H_eV';
     $capche_secret = '6LdI9wATAAAAAGAb9tN6ugLnTWFfHUtb3XCc8YdQ';
     $response = Input::get('g-recaptcha-response');
     //check if the y are correct
     $results = file_get_contents('https://www.google.com/recaptcha/api/siteverify?secret=' . $capche_secret . '&response=' . $response . '&remoteip=' . $_SERVER['REMOTE_ADDR']);
     $response = json_decode($results);
     $response->success = true;
     # PRZ ReturningCustomerForm()
     if (isset($response->success) && $response->success) {
         $solved_capache = true;
     } else {
         $messages = new Illuminate\Support\MessageBag();
         $messages->add('You must prove you are human ', " <b>Capache Error</b>");
         Session::flash('ShowReturnPanel', true);
         Session::flash('SearchError', true);
         return Redirect::to('/')->withErrors($messages);
     }
     session::forget('Step3Completed');
     $search = $this->leadtracapi->FindClientByLastNameAndEmail($lastname, $email);
     if (!$search) {
         //Show the page & add errors!
         Session::flash('ShowReturnPanel', true);
         Session::flash('SearchError', true);
         Session::forget('fileNumber');
     } else {
         Session::put('fileNumber', $search);
         // lets see if they are upgrading/updating their profile (see if they have paid for anything.)
         $client = $this->GetClientFromSession(true);
         $upgrade = array('100% Payments Received', 'Process Payments');
         session::put('Step3Completed', true);
     }
     // register their browser id so that this is the primary one editing the file
     $this->System_Register_With_Clients_BrowserID();
     // run step 1, step 2.
     Session::flash('dont_auto_logout', true);
     return Redirect::to('/');
 }
開發者ID:jordone,項目名稱:diyonline,代碼行數:44,代碼來源:ClientController.php


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