本文整理汇总了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);
}
示例2: logout
public function logout()
{
Auth::logout();
// log the user out of our application
Session::flush();
return Redirect::to('login');
}
示例3: get_logout
public function get_logout()
{
//GET LOGOUT
Auth::logout();
Session::flush();
return Redirect::to_action('cms::login');
}
示例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)));
});
});
});
}
示例5: logout
public function logout()
{
Auth::logout();
LoggedInUser::remove();
Session::flush();
return Redirect::route('home');
}
示例6: checkEligibility
public static function checkEligibility($unit, $data = [])
{
$ret = application_requirement::ok($unit, $data);
if (!$ret) {
Session::flush('not-eligible', Messages::notEligible());
}
}
示例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());
}
}
示例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
}
示例9: logout
public static function logout()
{
if (Session::has('eid')) {
Session::flush();
return Redirect::to('/');
}
}
示例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
}
示例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');
}
示例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'));
}
示例13: getLolgout
public function getLolgout()
{
Auth::logout();
$this->auth->logout();
Session::flush();
return redirect('/');
}
示例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 : '/');
}
示例15: destroy
/**
* Destroy user session
*
* @return Response
*/
public function destroy($id)
{
if (Session::get('user.token')) {
Session::flush();
}
return array('logged' => false);
}