本文整理汇总了PHP中Illuminate\Support\Facades\Session::remove方法的典型用法代码示例。如果您正苦于以下问题:PHP Session::remove方法的具体用法?PHP Session::remove怎么用?PHP Session::remove使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Support\Facades\Session
的用法示例。
在下文中一共展示了Session::remove方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: logout
/**
* 后台退出登陆
*
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function logout()
{
Session::remove('admin_id');
Session::remove('admin_user');
Session::remove('admin_level');
return redirect('admin/login');
}
示例2: handle
public function handle($request, Closure $next)
{
$uid = Session::get('admin_id');
$level = Session::get('admin_level');
if (AdminUser::find($uid ? $uid : 0) and $level == 1) {
return $next($request);
} else {
Session::remove('admin_id');
Session::remove('admin_user');
Session::remove('admin_level');
return redirect('admin/login');
}
}
示例3: place
public function place(Order $orderModel, OrderItem $orderItem)
{
if (!Session::has('cart')) {
return 'false';
}
$cart = Session::get('cart');
if ($cart->getTotal() > 0) {
$order = $orderModel->create(['user_id' => Auth::user()->id, 'total' => $cart->getTotal()]);
foreach ($cart->all() as $key => $item) {
$order->items()->create(['product_id' => $key, 'price' => $item['price'], 'qtd' => $item['qtd']]);
}
}
Session::remove('cart');
return redirect()->route('store.index');
}
示例4: postLogin
function postLogin()
{
$user = User::where('password', '=', Input::get('password'))->where('username', '=', Input::get('username'))->get()->first();
if ($user == null) {
Session::flash('message', 'Sorry, the details you entered could not be validated, please try again or contact support on +61 8 6102 5117');
return Redirect::to('/admin-login');
}
Auth::login($user);
$cookie = self::newCookie($user);
if (Session::has('return_url')) {
$ret = Session::get('return_url');
Session::remove('return_url');
return Redirect::to($ret)->withCookie($cookie);
}
return Redirect::to('/admin')->withCookie($cookie);
}
示例5: remove
public static function remove()
{
return Session::remove(self::$name);
}
示例6: logout
/**
* @return RedirectResponse
*/
public function logout()
{
Session::remove('exam_attendee_login');
return redirect()->route('examLogin');
}
示例7: logout
public function logout()
{
Session::remove('uid');
Session::remove('username');
return redirect('login');
}
示例8: remove
/**
* Remove a key from storage.
*
* @param string $key The key to remove.
*
* @return null
*/
public function remove($key)
{
Session::remove($key);
}
示例9: logout
/**
* Logout from social accounts
*/
public function logout()
{
$this->hybridAuth->logoutAllProviders();
Session::remove('SocialAuth::profile');
Session::remove('SocialAuth::provider');
}