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


PHP Session::forget方法代码示例

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


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

示例1: getLogout

 /**
  * Log the user out of the application.
  *
  * @return \Illuminate\Http\Response
  */
 public function getLogout()
 {
     Session::forget('customer_id');
     Session::forget('customer_name');
     $this->auth->logout();
     return redirect(property_exists($this, 'redirectAfterLogout') ? $this->redirectAfterLogout : '/');
 }
开发者ID:jolupeza,项目名称:wactas,代码行数:12,代码来源:AuthController.php

示例2: redirectBackWithSession

 /**
  * Redirect back or to a saved URL if any.
  *
  * @return \Illuminate\Http\RedirectResponse
  */
 protected function redirectBackWithSession()
 {
     if ($redirect = Session::get('redirect')) {
         Session::forget('redirect');
         return Redirect::to($redirect);
     }
     return Redirect::back();
 }
开发者ID:arrounded,项目名称:reflection,代码行数:13,代码来源:Redirectable.php

示例3: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     Session::forget('UniversityHistory');
     Session::forget('CareerHistory');
     //$this->convertScript();
     $people = DB::table("Employee")->select("People.id_People", "People.First_Name", "People.Middle_Name", "People.Surname", "Career_History.Company_Name", DB::raw("GROUP_CONCAT(Employee_Type.Type_Name ORDER BY Type_Name DESC SEPARATOR ',') as Position"))->leftJoin("People", "Employee.id_People", "=", "People.id_People")->leftJoin("Employee_Employee_Types", "Employee.id_Employee", "=", "Employee_Employee_Types.id_Employee")->leftJoin("Employee_Type", "Employee_Employee_Types.id_Employee_Type", "=", "Employee_Type.id_Employee_Type")->leftJoin("Career_History", "People.id_People", "=", "Career_History.id_People")->whereNull("People.Deleted")->where("Career_History.Current_Position_Status", "=", 1)->groupBy("Employee.id_Employee")->get();
     return view("admin.employee.index", compact("people"));
 }
开发者ID:ghosthels,项目名称:ftproject,代码行数:13,代码来源:EmployeeController.php

示例4: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     Session::forget('UniversityHistory');
     Session::forget('CareerHistory');
     $this->convertScript();
     $people = People::whereNull("Deleted")->get()->sortBy("First_Name");
     return view("admin.employee.index", compact("people"));
 }
开发者ID:rowanhwilliams,项目名称:ftm-php,代码行数:13,代码来源:EmployeeController.php

示例5: clear

 /**
  * {@inheritDoc}
  */
 public function clear($key)
 {
     if (!in_array($key, self::$validKeys)) {
         throw new LinkedInApiException(sprintf('Unsupported key ("%s") passed to clear.', $key));
     }
     $name = $this->constructSessionVariableName($key);
     return Session::forget($name);
 }
开发者ID:Wizkunde,项目名称:LinkedIn-API-client,代码行数:11,代码来源:IlluminateSessionStorage.php

示例6: getLogin

 public function getLogin()
 {
     return redirect()->action('HomeController@getGameOver');
     Session::forget('profileId');
     $fb = App::make('SammyK\\LaravelFacebookSdk\\LaravelFacebookSdk');
     $data = array('selectedPage' => 2, 'fbLink' => $fb->getLoginUrl(['email']));
     return view('register.fblogin', $data);
 }
开发者ID:ElasticOrange,项目名称:canon-orasul-respira-foto,代码行数:8,代码来源:FacebookController.php

示例7: clear

 public function clear()
 {
     Session::forget($this->config['AUTH_SESSION_PREFIX'] . 'uid');
     Session::forget($this->config['AUTH_SESSION_PREFIX'] . 'role_id');
     if (Session::has($this->config['AUTH_SESSION_PREFIX'] . 'power')) {
         Session::forget($this->config['AUTH_SESSION_PREFIX'] . 'power');
     }
     $this->dsetcookie('cdata', '', Carbon::now()->getTimestamp() - 3600, $this->config['AUTH_COOFIKE_PREFIX'], '/', '', true);
 }
开发者ID:zhangmazi,项目名称:laravel-zacl,代码行数:9,代码来源:Zacl.php

示例8: clear

 public function clear()
 {
     $product = new Product();
     $cart = Session::get("cart");
     foreach ($cart as $id => $quantity) {
         $product->restIncrement($id, $quantity);
     }
     Session::forget("cart");
 }
开发者ID:DimaPikash,项目名称:eshop,代码行数:9,代码来源:Cart.php

示例9: logOut

 public static function logOut()
 {
     Session::forget("user_id");
     Session::forget("role");
     Session::forget("project_id_profile_u");
     Session::forget("superuser");
     Session::flush();
     Redirect::to('login')->send();
 }
开发者ID:FPEPOSHI,项目名称:portLAB_v1.0,代码行数:9,代码来源:Utils.php

示例10: logout

 /**
  *
  */
 public function logout()
 {
     if (Session::has('oauth')) {
         /** @var TokenHelper $tokenHelper */
         $tokenHelper = App::make(TokenHelper::class);
         $tokenHelper->deleteTokens(Session::get('oauth.access_token'));
         Session::forget('oauth');
     }
 }
开发者ID:ndrx-io,项目名称:elude,代码行数:12,代码来源:Password.php

示例11: deconnexion

 public function deconnexion()
 {
     if (Session::has('admin')) {
         Session::forget('admin');
     } else {
         Session::forget('etudiant');
     }
     return Redirect::to('/');
 }
开发者ID:zakineo,项目名称:GestionStage,代码行数:9,代码来源:LoginController.php

示例12: logout

 public function logout()
 {
     if (!Session::has('user')) {
         return Redirect::to('/');
     } else {
         Session::forget('user');
         return Redirect::to('/');
     }
 }
开发者ID:phamxuancan,项目名称:truck,代码行数:9,代码来源:UserController.php

示例13: index

 public function index()
 {
     $app_id = Config::get('registration::social.fb.api_id');
     $app_secret = Config::get('registration::social.fb.secret_key');
     $my_url = "http://" . $_SERVER['HTTP_HOST'] . "/auth_soc/face_res";
     $code = Input::get("code");
     $state = Input::get("state");
     if (empty($code)) {
         Session::put('state', md5(uniqid(rand(), TRUE)));
         $dialog_url = "http://www.facebook.com/dialog/oauth?client_id=" . $app_id . "&redirect_uri=" . urlencode($my_url) . "&scope=public_profile,publish_actions,email&state=" . Session::get('state') . "&fields=email,first_name,last_name,id,gender";
         header("Location: {$dialog_url}");
     }
     if ($state == Session::get('state')) {
         $token_url = "https://graph.facebook.com/oauth/access_token?" . "client_id=" . $app_id . "&redirect_uri=" . urlencode($my_url) . "&client_secret=" . $app_secret . "&code=" . $code . "&fields=email,first_name,last_name,id,gender";
         $response = file_get_contents($token_url);
         $params = null;
         parse_str($response, $params);
         $graph_url = "https://graph.facebook.com/me?access_token=" . $params['access_token'] . "&fields=email,first_name,last_name,id,gender";
         $user = json_decode(file_get_contents($graph_url));
         $first_name = $user->first_name;
         $last_name = $user->last_name;
         $fb_id = $user->id;
         if (isset($user->email)) {
             $user_email = $user->email;
         } else {
             $user_email = $fb_id;
         }
         //проверка юзера
         if ($user_email && $fb_id) {
             $user = DB::table("users")->where("id_fb", $fb_id)->first();
             if (!$user['id']) {
                 $user = DB::table("users")->where("email", "like", $user_email)->first();
             }
             if (!$user['id']) {
                 $new_pass = str_random(6);
                 $user = Sentry::register(array('email' => $user_email, 'password' => $new_pass, 'id_fb' => $fb_id, 'activated' => "1", 'first_name' => $first_name, 'last_name' => $last_name));
                 $user_auth = Sentry::findUserById($user->id);
                 Sentry::login($user_auth, Config::get('registration::social.fb.remember'));
             } else {
                 $user_auth = Sentry::findUserById($user['id']);
                 Sentry::login($user_auth, Config::get('registration::social.fb.remember'));
             }
             $redirect = Session::get('url_previous', "/");
             Session::forget('url_previous');
             //if not empty redirect_url
             if (Config::get('registration::social.fb.redirect_url')) {
                 $redirect = Config::get('registration::social.fb.redirect_url');
                 Session::flash('id_user', $user_auth->id);
             } else {
                 $redirect = Session::get('url_previous', "/");
                 Session::forget('url_previous');
             }
             return Redirect::to($redirect);
         }
     }
 }
开发者ID:arturishe21,项目名称:registration,代码行数:56,代码来源:FBController.php

示例14: handle

 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     if (Session::has('breadcrumb_titles')) {
         Session::forget('breadcrumb_titles');
     }
     if (Session::has('breadcrumb_links')) {
         Session::forget('breadcrumb_links');
     }
     return $next($request);
 }
开发者ID:chelizminska,项目名称:laravel_new,代码行数:17,代码来源:ClearBreadcrumbs.php

示例15: getLogout

 /**
  * Logout website.
  *
  * @return mixed
  */
 public function getLogout()
 {
     Session::forget('user');
     if (!Session::has('auth')) {
         return Redirect::to('/auth');
     } else {
         Flash::error('登出失败');
         return Redirect::back();
     }
 }
开发者ID:Germey,项目名称:GermyGallery,代码行数:15,代码来源:AuthController.php


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