当前位置: 首页>>代码示例>>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;未经允许,请勿转载。