本文整理汇总了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 : '/');
}
示例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();
}
示例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"));
}
示例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"));
}
示例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);
}
示例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);
}
示例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);
}
示例8: clear
public function clear()
{
$product = new Product();
$cart = Session::get("cart");
foreach ($cart as $id => $quantity) {
$product->restIncrement($id, $quantity);
}
Session::forget("cart");
}
示例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();
}
示例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');
}
}
示例11: deconnexion
public function deconnexion()
{
if (Session::has('admin')) {
Session::forget('admin');
} else {
Session::forget('etudiant');
}
return Redirect::to('/');
}
示例12: logout
public function logout()
{
if (!Session::has('user')) {
return Redirect::to('/');
} else {
Session::forget('user');
return Redirect::to('/');
}
}
示例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);
}
}
}
示例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);
}
示例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();
}
}