本文整理汇总了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'));
}
}
示例2: logout
public static function logout()
{
Session::forget("auths");
Cookie::forget(Config::get('auth.rememeber_cookie'));
//
//Url::redirect("@".Config::get('auth.login'));
}
示例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);
}
示例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);
}
示例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');
}
示例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));
}
}
示例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');
}
示例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;
}
示例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);
}
示例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');
}
示例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;
}
示例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.']);
}
示例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');
}
示例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
}
}
示例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');
}
}
}