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


PHP Session::forget方法代码示例

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


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

示例1: logout

 public function logout(Request $request)
 {
     $posts = \App\Post::orderBy('updated_at', 'desc')->paginate($this->peginate_pages_count);
     $users = \App\User::all();
     \Session::forget('user_id');
     return Redirect::action('ExampleController@index');
 }
开发者ID:JustSAT,项目名称:shevchenko-blog,代码行数:7,代码来源:ExampleController.php

示例2: getPaymentStatus

 public function getPaymentStatus()
 {
     // Get the payment ID before session clear
     $payment_id = \Session::get('paypal_payment_id');
     // clear the session payment ID
     \Session::forget('paypal_payment_id');
     if (empty(\Input::get('PayerID')) || empty(\Input::get('token'))) {
         return \Redirect::route('original.route')->with('error', 'Payment failed');
     }
     $payment = Payment::get($payment_id, $this->_api_context);
     // PaymentExecution object includes information necessary
     // to execute a PayPal account payment.
     // The payer_id is added to the request query parameters
     // when the user is redirected from paypal back to your site
     $execution = new PaymentExecution();
     $execution->setPayerId(\Input::get('PayerID'));
     //Execute the payment
     $result = $payment->execute($execution, $this->_api_context);
     echo '<pre>';
     print_r($result);
     echo '</pre>';
     exit;
     // DEBUG RESULT, remove it later
     if ($result->getState() == 'approved') {
         // payment made
         return \Redirect::route('original.route')->with('success', 'Payment success');
     }
     return \Redirect::route('original.route')->with('error', 'Payment failed');
 }
开发者ID:ashley2126,项目名称:edronscateringservices2,代码行数:29,代码来源:IndexController.php

示例3: autoLogin

 private function autoLogin()
 {
     try {
         if (\Session::has('userID')) {
         } else {
             //try set session from cookies if no session
             if (!empty(\Cookie::get('userID'))) {
                 $field = array('field' => '_id', 'value' => (string) \Cookie::get('userID'));
                 if (Auth::isExists($field)) {
                     \Session::put('userID', \Cookie::get('userID'));
                     //
                     //return \Response::make()->withCookie(\Cookie::make('userID', \Cookie::get('userID') , self::COOKIE_EXPIRE));
                 } else {
                     throw new AuthCheckException('username', 'auth.username.doesnt.exist');
                 }
             } else {
                 //\Session::forget('userID')->withCookie(\Cookie::forget('userID'))->withCookie(\Cookie::forget('userID'));
                 throw new AuthCheckException('userid', 'auth.userid.doesnt.exist');
             }
         }
     } catch (Exception $e) {
         $return = \Response::json(["message" => "Session logout!"], 400);
         \Session::forget('userID');
         return $return->withCookie(Cookie::forget('userID'))->withCookie(Cookie::forget('userID'));
     }
 }
开发者ID:stevetay,项目名称:MCMC,代码行数:26,代码来源:RegionController.php

示例4: getLogout

 public function getLogout()
 {
     if (\Session::has('UserID')) {
         \Session::forget('UserID');
     }
     $this->auth->logout();
     return redirect(url('/user/login'));
 }
开发者ID:bluelinemango,项目名称:mango,代码行数:8,代码来源:LoginController.php

示例5: delete

 public function delete($id)
 {
     if (\Session::has('product8')) {
         \Session::forget('product8.' . $id);
         $kol = \Session::get('addToBasket');
         \Session::forget('addToBasket', $kol - 1);
     }
     return redirect('basket');
 }
开发者ID:rmvl,项目名称:mebeli-magaz,代码行数:9,代码来源:BasketController.php

示例6: toRemove

 public function toRemove()
 {
     if (session('organization') == null) {
         return redirect('/home/organizations/home');
     } else {
         \Session::forget('organization');
         return redirect('/home/organizations');
     }
 }
开发者ID:RyOberfelder,项目名称:ccard,代码行数:9,代码来源:OrganizationsController.php

示例7: getPaymentStatus

 public function getPaymentStatus()
 {
     // Get the payment ID before session clear
     $payment_id = \Session::get('paypal_payment_id');
     $order_id = \Session::get('order_id');
     \Session::forget('paypal_payment_id');
     \Session::forget('order_id');
     if (empty(\Input::get('PayerID')) || empty(\Input::get('token'))) {
         // payment failure actions
         \Session::put('cart_preview', $this->BuyModel->cartPreview(['buyer_id' => $this->user]));
         $this->BuyModel->removeFromPreorder(['buyer_id' => $this->user]);
         $this->BuyModel->deleteOrderId($order_id);
         // end payment failure actions
         return redirect('checkout')->with('alert', 'Payment cancelled');
     }
     $payment = Payment::get($payment_id, $this->_api_context);
     // PaymentExecution object includes information necessary
     // to execute a PayPal account payment.
     // The payer_id is added to the request query parameters
     // when the user is redirected from paypal back to your site
     $execution = new PaymentExecution();
     $execution->setPayerId(\Input::get('PayerID'));
     //Execute the payment
     $result = $payment->execute($execution, $this->_api_context);
     $paypal = ['order_id' => $order_id];
     $args = ['buyer_id' => $this->user];
     if ($result->getState() == 'approved') {
         // payment made
         $paypal['payment_id'] = $result->getId();
         $paypal['status'] = $result->getState();
         $paypal['create_time'] = $result->getCreateTime();
         $paypal['email'] = $result->getPayer()->getPayerInfo()->getEmail();
         $payerAddress = $result->getPayer()->getPayerInfo()->getShippingAddress();
         $paypal['line1'] = $payerAddress->getLine1();
         $paypal['city'] = $payerAddress->getCity();
         $paypal['state'] = $payerAddress->getState();
         $paypal['postal_code'] = $payerAddress->getPostalCode();
         $paypal['country_code'] = $payerAddress->getCountryCode();
         unset($payerAddress);
         $transaction = $result->getTransactions()[0]->getAmount();
         $paypal['total'] = $transaction->getTotal() * 100;
         $paypal['currency'] = $transaction->getCurrency();
         unset($transaction);
         $this->BuyModel->insertPayment($paypal);
         $args['checkout'] = 1;
         $info = ['order_id' => $order_id];
         $this->BuyModel->insertOrderItems($info, $args);
         $this->BuyModel->deleteFromCart($args);
         //    email sellers to ship
         // $headers = "From: orders@colorcreep.com";
         $text = "Your Order " . $order_id . " has processed.";
         mail($paypal['email'], "Your Color Creep Order", $text);
         return redirect('order?id=' . $order_id)->with('alert', 'Payment complete');
     } else {
         $this->BuyModel->removeFromPreorder($args);
         $this->BuyModel->deleteOrderId($order_id);
         return redirect('cart')->with('alert', 'There was an error processing your payment');
     }
     return redirect('cart');
 }
开发者ID:vincentgbs,项目名称:mtgmarketplace,代码行数:60,代码来源:PaypalController.php

示例8: exitSupport

 public function exitSupport()
 {
     Auth::logout();
     \Session::forget('support');
     $id = \Session::get('id_support');
     $user = User::findOrFail($id);
     $userPassword = UserPassword::whereRaw('user_id = ?', array($id))->first();
     $decrypted = \Crypt::decrypt($userPassword->crypt_password);
     if (Auth::attempt(['email' => $user->email, 'password' => $decrypted])) {
         return new RedirectResponse(url('/home'));
     } else {
         return new RedirectResponse(url('/home'));
     }
 }
开发者ID:keiwerkgvr,项目名称:salesperformanceindicator,代码行数:14,代码来源:UserController.php

示例9:

 function back_button()
 {
     if (\Session::has('entry_date')) {
         \Session::forget('entry_date');
     }
     $active = $this->check();
     if ($active) {
         $Session = \Session::all();
         //return view('Dashboard', compact('Session'));
         return \Redirect::to('dashboard');
     } else {
         return \Redirect::to('login');
     }
 }
开发者ID:blogakgec,项目名称:dc-project2015,代码行数:14,代码来源:DashboardController.php

示例10: logOut

 public function logOut(Request $request)
 {
     \Session::forget('username');
     ParseUser::logOut();
     return redirect('/');
 }
开发者ID:whizdummy,项目名称:Farmers-Plaza-Web,代码行数:6,代码来源:PageController.php

示例11: postLogout

 public function postLogout()
 {
     \Session::forget('fb_user_id');
     return \Response::json(['success' => true]);
 }
开发者ID:nekonekonik,项目名称:nuswhispers,代码行数:5,代码来源:FbUsersController.php

示例12: trash

 public function trash()
 {
     \Session::forget('cart');
     return redirect()->route('cart-show');
 }
开发者ID:kazamax,项目名称:tienda,代码行数:5,代码来源:CartController.php

示例13: getComplete

 /**
  * @author NgocNguyen
  * @name getComplete
  * @todo view complete page
  * @return Response
  * @access public
  */
 public function getComplete($catalogItem)
 {
     $form = \Helper::getFormTable($catalogItem);
     if ($form == 'input-r2') {
         return view('pages.default.catalog.r2.complete-r2', ['form' => $form, 'flag' => 'complete']);
     }
     // get flag for view
     $flag = $this->selectDefault($catalogItem);
     \Session::forget('dct');
     return view('pages.default.catalog.complete', ['catalogItem' => $catalogItem, 'panel' => $this->checkVisualArea($catalogItem), 'flag' => $flag]);
 }
开发者ID:vodanh624321,项目名称:laravel5,代码行数:18,代码来源:CatalogController.php

示例14: postComplete

 /**
  * show and handle compete page
  *
  * @author My Vo
  *
  * @return \Illuminate\View\View
  */
 public function postComplete(Prj02FormR5 $prj02FormR5, CatalogFormR5 $catalogFormR5)
 {
     // Get platform
     $platFormID = \Session::get('id');
     // Return to cache
     \Helper::catalogLoad($platFormID, $prj02FormR5->platformName);
     $catalogList = $prj02FormR5->platformName . $platFormID . 'List';
     // get item from cache
     $listItem = \Cache::get($catalogList);
     $arrItem = \Session::get('dct');
     foreach ($arrItem as $key => $value) {
         if (empty($value)) {
             break;
         }
         $arrItem[$key] = array_shift($listItem[$value]);
     }
     // ext1 field data
     $item = implode(',', $arrItem);
     //serial number
     $serial_number = date('yymm-55');
     //Registration date
     //※2015年 7月 6日(月曜日) 17時 29分
     $youbi = ['日', '月', '火', '水', '木', '金', '土'];
     $registration_date = date('Y年 n月 j日(') . $youbi[date('w')] . date(') G:i');
     // Select model and system name by catalogItem
     $systemData = \Helper::getItemInfo("constants.system_catalog.{$this->catalogItem}");
     $prj02FormR5->fill($catalogFormR5->all());
     $prj02FormR5['name1'] = $prj02FormR5['name1'] . " " . $prj02FormR5['name2'];
     $prj02FormR5['kana1'] = $prj02FormR5['kana1'] . " " . $prj02FormR5['kana2'];
     $prj02FormR5['address1'] = $prj02FormR5['area'] . $prj02FormR5['address1'];
     $prj02FormR5['ext8'] = $prj02FormR5['ext8'] . $prj02FormR5['ext9'];
     $prj02FormR5['ext1'] = $item;
     $prj02FormR5['form'] = $systemData['form'];
     $prj02FormR5['uid'] = $systemData['uid'];
     $prj02FormR5['ext6'] = $serial_number;
     $prj02FormR5['ext7'] = $registration_date;
     $prj02FormR5['ext11'] = '希望しない';
     $prj02FormR5['ext12'] = '希望しない';
     // unset attributes
     unset($prj02FormR5['name2']);
     unset($prj02FormR5['kana2']);
     unset($prj02FormR5['area']);
     unset($prj02FormR5['ext9']);
     // array item send email
     $arrItem = $prj02FormR5->getAttributes();
     // save
     $prj02FormR5->save();
     // Get subject, URL
     $arrItem['URL'] = \Helper::getItemInfo("constants.system_catalog.{$this->catalogItem}")['URL'];
     $arrItem['subject'] = \Helper::getItemInfo("constants.system_catalog.{$this->catalogItem}")['MailSubjectAdmin'];
     $arrItem['CATALOG_ITEM'] = 'catalog_' . $this->catalogItem;
     // Send mail admin
     \Helper::sendMailAdmin($arrItem, $arrItem['subject']);
     // Send mail user
     $subject = \Helper::getItemInfo("constants.system_catalog.{$this->catalogItem}")['MailSubjectClient'];
     \Helper::sendMailUser($arrItem, $arrItem['email1'], $subject);
     \Session::regenerateToken();
     \Session::forget('dct');
     \Session::forget('id');
     \Session::forget('info_input');
     \Session::forget('cat_item');
     return view('pages.default.catalog.r5.complete');
 }
开发者ID:vodanh624321,项目名称:laravel5,代码行数:70,代码来源:CatalogR5Controller.php

示例15: nuevoPlanMunicipal

 /**
  * Display a listing of the resource.
  * Muestra la vista principal para Gestionar un Plan de Desarrollo
  * @return Response
  */
 public function nuevoPlanMunicipal()
 {
     \Session::forget('id_plan');
     return view('template.PlanDesarrollo.registrar_plan.new_plan');
 }
开发者ID:jumaya,项目名称:redbpim,代码行数:10,代码来源:planDesarrolloController.php


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