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


PHP Session::flush方法代碼示例

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


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

示例1: testFlush

 public function testFlush()
 {
     $this->target->set('bindable.dummy.xyzzy', 'hogefuga');
     $this->target->bind($this->bindable);
     \Phake::when($this->bindable)->getSessionContent()->thenReturn(array('hoge' => 'hogehoge', 'xyzzy' => 'piyopiyo'));
     $this->target->flush();
     $this->assertEquals(array('HOGE' => 1, 'FUGA' => 2, 'PIYO' => array('FIZZ' => 'BUZZ'), 'bindable' => array('dummy' => array('hoge' => 'hogehoge', 'xyzzy' => 'piyopiyo'))), $_SESSION);
 }
開發者ID:aainc,項目名稱:Hoimi,代碼行數:8,代碼來源:SessionTest.php

示例2: logout

 public function logout()
 {
     Auth::logout();
     // log the user out of our application
     Session::flush();
     return Redirect::to('login');
 }
開發者ID:reggi49,項目名稱:modesty.laravel,代碼行數:7,代碼來源:LoginController.php

示例3: get_logout

 public function get_logout()
 {
     //GET LOGOUT
     Auth::logout();
     Session::flush();
     return Redirect::to_action('cms::login');
 }
開發者ID:SerdarSanri,項目名稱:PongoCMS-Laravel-cms-bundle,代碼行數:7,代碼來源:login.php

示例4: map

 /**
  * @param Router $router
  */
 public function map(Router $router)
 {
     $router->group(['namespace' => $this->namespace, 'prefix' => 'backend', 'middleware' => ['web', 'theme:backend', 'lang', 'configure:backend']], function (Router $router) {
         $router->get('/', function () {
             return redirect(url('backend/c/dashboard'));
         });
         $router->group(['middleware' => 'guest'], function (Router $router) {
             $router->get('login', 'Auth\\AuthController@getLogin');
             $router->post('login', 'Auth\\AuthController@postLogin');
             $router->get('forgot-password', 'Auth\\PasswordController@getEmail');
             $router->post('forgot-password', 'Auth\\PasswordController@postEmail');
             $router->get('reset-password/{code}', 'Auth\\PasswordController@getReset');
             $router->post('reset-password', 'Auth\\PasswordController@postReset');
         });
         $router->group(['middleware' => 'auth:admin'], function (Router $router) {
             $router->get('logout', function () {
                 \Auth::logout();
                 \Session::flush();
                 return redirect('/backend/login');
             });
             $router->any('c/{controller}', function (Request $request, $controller) {
                 return app()->call($this->namespace . '\\' . ucfirst($controller) . 'Controller@' . ucfirst(strtolower($request->method())) . 'Index');
             });
             $router->any('c/{controller}/a/{action}', function (Request $request, $controller, $action) {
                 return app()->call($this->namespace . '\\' . ucfirst($controller) . 'Controller@' . ucfirst(strtolower($request->method())) . ucfirst(strtolower($action)));
             });
         });
     });
 }
開發者ID:shopvel,項目名稱:shopvel,代碼行數:32,代碼來源:BackendServiceProvider.php

示例5: logout

 public function logout()
 {
     Auth::logout();
     LoggedInUser::remove();
     Session::flush();
     return Redirect::route('home');
 }
開發者ID:anthrotech,項目名稱:laravel_sample,代碼行數:7,代碼來源:UserController.php

示例6: checkEligibility

 public static function checkEligibility($unit, $data = [])
 {
     $ret = application_requirement::ok($unit, $data);
     if (!$ret) {
         Session::flush('not-eligible', Messages::notEligible());
     }
 }
開發者ID:ahmed-dinar,項目名稱:JUSTAS,代碼行數:7,代碼來源:application_requirement.php

示例7: postLogin

 public function postLogin()
 {
     include app_path() . "/include/cifrado.php";
     $errores = new Errores();
     $empresas = new Empresa();
     $data = Input::all();
     $empresa = $empresas->getEmpresabyEmail($data['email']);
     if (!$empresa) {
         $errores->addError('Usuario o contraseña incorrectos');
         return Redirect::action('Empresa_EmpresaController@getLogin')->with('errores', $errores->all());
     }
     $pass = $empresa->password;
     if (descifrar($data['password'], $pass)) {
         Session::flush();
         Session::put('ip_address', $_SERVER['REMOTE_ADDR']);
         Session::put('logged_empresa', true);
         Session::put('id_empresa', $empresa->id);
         $empresa->accesos_erroneos = 0;
         $empresa->save();
         //return Redirect::action('Empresa_EmpresaController@getIndex');
         return Redirect::intended('empresa/index');
     } else {
         $accesos = $empresa->accesos_erroneos;
         $empresa->accesos_erroneos++;
         $empresa->save();
         Session::flush();
         $errores->addError('Usuario o contraseña incorrectos');
         return Redirect::action('Empresa_EmpresaController@getLogin')->with('errores', $errores->all());
     }
 }
開發者ID:albafo,項目名稱:web.Adehon,代碼行數:30,代碼來源:EmpresaController.php

示例8: login

 /**
  * Display listing of the resource
  *
  * @return Response
  */
 public function login()
 {
     //set the user array to gather data from user form
     $userdata = array('username' => Input::get('username'), 'password' => Input::get('password'));
     /*
     $hashpassword = Hash::Make(Input::get('password'));
     var_dump($hashpassword);
     die();
     */
     if (Auth::check()) {
         return Redirect::to('/');
     }
     if (Auth::attempt($userdata)) {
         // cauta userul in baza de date
         $user = UserModel::find(Auth::user()->id);
         if ($user->active == 0) {
             //daca userul nu este activ
             Auth::logout();
             Session::flush();
             return Redirect::to('login')->with('message', FlashMessage::DisplayAlert('Login successful', 'success'));
         }
         //if($user->active == '0')
         //daca userul este activ
         Session::put('current_user', Input::get('username'));
         Session::put('user_access', $user->access);
         Session::put('user_id', $user->id);
         return Redirect::to('/');
     } else {
         return Redirect::to('login')->with('message', FlashMessage::DisplayAlert('Incorrect username or password', 'danger'));
     }
     //else if Auth
 }
開發者ID:dannyneamtu,項目名稱:lara_project1,代碼行數:37,代碼來源:UserController.php

示例9: logout

 public static function logout()
 {
     if (Session::has('eid')) {
         Session::flush();
         return Redirect::to('/');
     }
 }
開發者ID:mahaverick,項目名稱:InternsApp,代碼行數:7,代碼來源:EmployersController.php

示例10: dologout

 /**
  * function name : dologout
  * logout system
  * clear session data
  */
 public function dologout()
 {
     Session::flush();
     //delete the session
     return Redirect::to('/');
     // redirect the user to the login screen
 }
開發者ID:themesanasang,項目名稱:salary,代碼行數:12,代碼來源:LoginController.php

示例11: getLogout

 public function getLogout()
 {
     Session::flush();
     Cookie::forget('laravel_session');
     Auth::logout();
     return Redirect::to('/')->with('success_messages', 'Vuelve Pronto')->with('alert-class', 'alert-success');
 }
開發者ID:chuckrincon,項目名稱:shareon,代碼行數:7,代碼來源:LoginController.php

示例12: inventory

 public function inventory()
 {
     Session::flush();
     $items = Catalog::orderBy('created_at', 'desc')->get();
     $page = Page::where('type', '=', 3)->firstOrFail();
     return View::make('front.pages.inventory', compact('items', 'page'));
 }
開發者ID:stefferd,項目名稱:autogarageooij,代碼行數:7,代碼來源:FrontController.php

示例13: getLolgout

 public function getLolgout()
 {
     Auth::logout();
     $this->auth->logout();
     Session::flush();
     return redirect('/');
 }
開發者ID:machiidev,項目名稱:chli,代碼行數:7,代碼來源:AuthController.php

示例14: getLogout

 public function getLogout()
 {
     \Auth::logout();
     \Session::flash('flash_message', 'You have been logged out.');
     \Session::flush();
     return redirect(property_exists($this, 'redirectAfterLogout') ? $this->redirectAfterLogout : '/');
 }
開發者ID:joyabia,項目名稱:p4,代碼行數:7,代碼來源:AuthController.php

示例15: destroy

 /**
  * Destroy user session
  * 
  * @return Response
  */
 public function destroy($id)
 {
     if (Session::get('user.token')) {
         Session::flush();
     }
     return array('logged' => false);
 }
開發者ID:Yatko,項目名稱:Gifteng,代碼行數:12,代碼來源:AuthController.php


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