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


PHP Cookie::forget方法代碼示例

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


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

示例1: autoLogin

 private function autoLogin()
 {
     try {
         if (\Session::has('userID')) {
         } else {
             //try set session from cookies if no session
             if (!empty(\Cookie::get('userID'))) {
                 $field = array('field' => '_id', 'value' => (string) \Cookie::get('userID'));
                 if (Auth::isExists($field)) {
                     \Session::put('userID', \Cookie::get('userID'));
                     //
                     //return \Response::make()->withCookie(\Cookie::make('userID', \Cookie::get('userID') , self::COOKIE_EXPIRE));
                 } else {
                     throw new AuthCheckException('username', 'auth.username.doesnt.exist');
                 }
             } else {
                 //\Session::forget('userID')->withCookie(\Cookie::forget('userID'))->withCookie(\Cookie::forget('userID'));
                 throw new AuthCheckException('userid', 'auth.userid.doesnt.exist');
             }
         }
     } catch (Exception $e) {
         $return = \Response::json(["message" => "Session logout!"], 400);
         \Session::forget('userID');
         return $return->withCookie(Cookie::forget('userID'))->withCookie(Cookie::forget('userID'));
     }
 }
開發者ID:stevetay,項目名稱:MCMC,代碼行數:26,代碼來源:RegionController.php

示例2: logout

 public static function logout()
 {
     Session::forget("auths");
     Cookie::forget(Config::get('auth.rememeber_cookie'));
     //
     //Url::redirect("@".Config::get('auth.login'));
 }
開發者ID:amineabri,項目名稱:Fiesta,代碼行數:7,代碼來源:Auth.php

示例3: store

 /**
  * Store a newly created song in storage.
  *
  * @return Response
  */
 public function store()
 {
     // Set rules for validator
     $rules = array("artist" => "required", "title" => "required", "requester" => "required", "link" => "required|url");
     // Validate input
     $validator = Validator::make(Input::all(), $rules);
     if ($validator->fails()) {
         // TODO: Remember form input...
         return Redirect::to('song/create')->withErrors($validator, "song");
     }
     // Create new song
     $song = Input::all();
     // Set or unset remember cookie
     if (isset($song['remember-requester'])) {
         $cookie = Cookie::make("requester", $song['requester']);
     } else {
         $cookie = Cookie::forget("requester");
     }
     $artist = DB::getPdo()->quote($song['artist']);
     $title = DB::getPdo()->quote($song['title']);
     if (Song::whereRaw("LOWER(artist) = LOWER({$artist}) AND LOWER(title) = LOWER({$title})")->count() > 0) {
         return Redirect::to('song/create')->with('error', "HEBBEN WE AL!!!")->withCookie($cookie);
     }
     Song::create($song);
     // Set success message
     $msg = "Gefeliciteerd! Je nummer is aangevraagd :D";
     // Redirect to song index page with message and cookie
     return Redirect::to("/")->with("success", $msg)->withCookie($cookie);
 }
開發者ID:SanderVerkuil,項目名稱:molenpark,代碼行數:34,代碼來源:SongsController.php

示例4: callback

 public function callback()
 {
     // Create an consumer from the config
     $this->consumer = Consumer::make($this->config);
     // Load the provider
     $this->provider = Provider::make($this->provider);
     if ($token = \Cookie::get('oauth_token')) {
         // Get the token from storage
         $this->token = unserialize(base64_decode($token));
     }
     if (!property_exists($this, 'token')) {
         throw new Exception('Invalid token');
     }
     if ($this->token and $this->token->access_token !== \Input::get('oauth_token')) {
         // Delete the token, it is not valid
         \Cookie::forget('oauth_token');
         // Send the user back to the beginning
         throw new Exception('invalid token after coming back to site');
     }
     // Get the verifier
     $verifier = \Input::get('oauth_verifier');
     // Store the verifier in the token
     $this->token->verifier($verifier);
     // Exchange the request token for an access token
     return $this->provider->access_token($this->token, $this->consumer);
 }
開發者ID:marmaray,項目名稱:OLD-laravel-France-website,代碼行數:26,代碼來源:oauth.php

示例5: logout

 /**
  * Triggers the logout process, purges Cookies and session.
  */
 public static function logout()
 {
     Session::forget('Ravenly.user');
     Session::forget('Ravenly.crsid');
     Cookie::forget('Ravenly.UcamWebauth');
     Cookie::forget('ravenly');
 }
開發者ID:SerdarSanri,項目名稱:Ravenly,代碼行數:10,代碼來源:ravenly.php

示例6: postIndex

 public function postIndex()
 {
     $input = Input::only('first_name', 'last_name', 'email', 'username', 'password', 'domain_id');
     $domain_id = Cookie::get('domain_hash') ? Cookie::get('domain_hash') : 'NULL';
     $rules = array('first_name' => 'required|min:1', 'email' => 'required|email|unique:users,email,NULL,id,deleted_at,NULL,domain_id,' . $domain_id, 'username' => 'required|min:3|must_alpha_num|unique:users,username,NULL,id,deleted_at,NULL,domain_id,' . $domain_id, 'password' => 'required|min:6');
     $v = Validator::make($input, $rules);
     if ($v->fails()) {
         return Output::push(array('path' => 'register', 'errors' => $v, 'input' => TRUE));
     }
     $profile = new Profile(array('first_name' => $input['first_name'], 'last_name' => $input['last_name'], 'website' => ''));
     $profile->save();
     $user = new User(array('domain_id' => Cookie::get('domain_hash') ? Cookie::get('domain_hash') : NULL, 'email' => $input['email'], 'username' => $input['username'], 'password' => Hash::make($input['password']), 'status' => Cookie::get('domain_hash') ? 4 : 3));
     $user->profile()->associate($profile);
     $user->save();
     if ($user->id) {
         if ($user->status == 4) {
             $this->add_phone_number($user->id);
         }
         $cookie = Cookie::forget('rndext');
         $confirmation = App::make('email-confirmation');
         $confirmation->send($user);
         Mail::send('emails.register', array('new_user' => $input['username']), function ($message) {
             $message->from(Config::get('mail.from.address'), Config::get('mail.from.name'))->to(Input::get('email'))->subject(_('New user registration'));
         });
         Event::fire('logger', array(array('account_register', array('id' => $user->id, 'username' => $user->username), 2)));
         //			return Output::push(array(
         //				'path' => 'register',
         //				'messages' => array('success' => _('You have registered successfully')),
         //				));
         return Redirect::to('register')->with('success', _('You have registered successfully'))->withCookie($cookie);
     } else {
         return Output::push(array('path' => 'register', 'messages' => array('fail' => _('Fail to register')), 'input' => TRUE));
     }
 }
開發者ID:digideskio,項目名稱:voip-id,代碼行數:34,代碼來源:RegisterController.php

示例7: 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

示例8: unsetCart

 public static function unsetCart()
 {
     $key = \Request::cookie('shoppingCart');
     $cart = \App\Cart::where('key', $key)->first();
     $cookie = \Cookie::forget('shoppingCart');
     $cart->delete();
     return $cookie;
 }
開發者ID:Qeenslet,項目名稱:wireworks,代碼行數:8,代碼來源:shoppingCart.php

示例9: logout

 public function logout()
 {
     $admin_id = Cookie::forget('admin_id');
     $admin_username = Cookie::forget('admin_username');
     $k = Cookie::forget('k');
     $login_time = Cookie::forget('login_time');
     return Redirect::route('home')->withCookie($k)->withCookie($admin_id)->withCookie($admin_username)->withCookie($login_time);
 }
開發者ID:mingshi,項目名稱:printer-backend,代碼行數:8,代碼來源:EntryController.php

示例10: postDelete

 public function postDelete()
 {
     $Usuario = Usuario::find(Input::get('Usuario')['id'])->update(Input::get('Usuario'));
     Session::flush();
     Cookie::forget('laravel_session');
     Auth::logout();
     return Redirect::to('/')->with('success_messages', 'Lamentamos que te hayas ido, esperamos volverte a ver')->with('alert-class', 'alert-success');
 }
開發者ID:chuckrincon,項目名稱:shareon,代碼行數:8,代碼來源:UsuarioController.php

示例11: _setCookie

 private function _setCookie()
 {
     if (Auth::user()->status == 4) {
         $cookie = Cookie::make('domain_hash', Auth::user()->domain_id);
     } else {
         $cookie = Cookie::forget('domain_hash');
     }
     return $cookie;
 }
開發者ID:digideskio,項目名稱:voip-id,代碼行數:9,代碼來源:LoginController.php

示例12: ChecksiteLogin

 public function ChecksiteLogin()
 {
     if (Input::has('site-password')) {
         if (Input::get('site-password') == Config::get('config.site_password')) {
             $cookie = Cookie::forever('siteprotection', 'YES');
             return Redirect::back()->withCookie($cookie);
         }
     }
     Cookie::forget('siteprotection');
     return Redirect::back()->with(['errors' => 'Sorry wrong password for site.']);
 }
開發者ID:vanderlin,項目名稱:halp,代碼行數:11,代碼來源:PageController.php

示例13: create

 /**
  * View Login page
  * @return [type] [description]
  */
 public function create()
 {
     if (Auth::check()) {
         return Redirect::intended('/');
     }
     $cookies = Cookie::get();
     foreach ($cookies as $name => $cookie) {
         Cookie::queue(Cookie::forget($name));
     }
     return View::make('login');
 }
開發者ID:marklauyq,項目名稱:firstclass-dev,代碼行數:15,代碼來源:SessionsController.php

示例14: action_auth

 public function action_auth()
 {
     $email = Input::get('email');
     $pswd = Input::get('password');
     $creds = array('username' => $email, 'password' => $pswd);
     try {
         if (Auth::attempt($creds)) {
             if ($redir = Cookie::get('rid')) {
                 Cookie::forget('rid');
                 return Redirect::to($redir)->with_input();
             }
             return View::make('sapoc.pages.index');
         } else {
             return Redirect::to('login')->with('login_errors', true);
         }
     } catch (\Exception $e) {
         // TODO: Show Error page
     }
 }
開發者ID:rooslunn,項目名稱:sapoc,代碼行數:19,代碼來源:sapoc.php

示例15: __construct

 public function __construct()
 {
     session_start();
     FacebookSession::setDefaultApplication('355697367892039', '4e86edc58e5798b253dd55c164504512');
     $this->beforeFilter('csrf', array('on' => array('post', 'delete', 'put')));
     $fbuser = User::where('facebook_id', '=', Session::get('facebook_id'))->where('facebook_id', '<>', '')->first();
     if (isset($fbuser->id)) {
         Session::put('username', $fbuser->username);
         Session::put('user_level', $fbuser->user_level);
         Session::put('id', $fbuser->id);
     } elseif (Cookie::get('ps_login') && !Session::get('id')) {
         $user = unserialize(Cookie::get('ps_login'));
         if (isset($user->id)) {
             Session::put('username', $user['username']);
             Session::put('user_level', $user['user_level']);
             Session::put('id', $user['id']);
         } else {
             Cookie::forget('ps_login');
         }
     }
 }
開發者ID:Puskice,項目名稱:PuskiceCMS,代碼行數:21,代碼來源:BaseController.php


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