本文整理汇总了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');
}
示例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');
}
示例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'));
}
}
示例4: getLogout
public function getLogout()
{
if (\Session::has('UserID')) {
\Session::forget('UserID');
}
$this->auth->logout();
return redirect(url('/user/login'));
}
示例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');
}
示例6: toRemove
public function toRemove()
{
if (session('organization') == null) {
return redirect('/home/organizations/home');
} else {
\Session::forget('organization');
return redirect('/home/organizations');
}
}
示例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');
}
示例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'));
}
}
示例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');
}
}
示例10: logOut
public function logOut(Request $request)
{
\Session::forget('username');
ParseUser::logOut();
return redirect('/');
}
示例11: postLogout
public function postLogout()
{
\Session::forget('fb_user_id');
return \Response::json(['success' => true]);
}
示例12: trash
public function trash()
{
\Session::forget('cart');
return redirect()->route('cart-show');
}
示例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]);
}
示例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');
}
示例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');
}