本文整理汇总了PHP中delete_cookie函数的典型用法代码示例。如果您正苦于以下问题:PHP delete_cookie函数的具体用法?PHP delete_cookie怎么用?PHP delete_cookie使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了delete_cookie函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
public function index()
{
$this->load->helper('cookie');
delete_cookie('login');
$this->load->helper('url');
redirect('/login/', 'refresh');
}
示例2: _remap
function _remap($segment)
{
$this->load->library('session');
$this->session->sess_destroy();
$this->load->module_library(FUEL_FOLDER, 'fuel_auth');
$this->load->helper('cookie');
$this->fuel_auth->logout();
$config = array(
'name' => $this->fuel_auth->get_fuel_trigger_cookie_name(),
'path' => WEB_PATH
);
delete_cookie($config);
$redirect = $this->config->item('logout_redirect', 'fuel');
if ($redirect == ':last')
{
$this->load->helper('convert');
// if ($segment == 'index')
// {
// $redirect = fuel_uri('login');
// }
// else
// {
$redirect = uri_safe_decode($segment);
//}
}
redirect($redirect);
}
示例3: clear_level
function clear_level($name = 'ci_user')
{
/* Current CI instance, plus helper. */
$CI =& get_instance();
$CI->load->helper('cookie');
delete_cookie($name);
}
示例4: __construct
public function __construct()
{
$CI =& get_instance();
$this->u = $CI->input->cookie("scun", TRUE);
$this->p = $CI->input->cookie("sctkn", TRUE);
if ($this->u && $this->p) {
$user = $CI->db->select(" users.`ID`, users.`name`, users.`email`, users.`access_level`,\n\t\t\t \t users.`default_ticket_category`, users.`email_notification`, \n\t\t\t \t users.`locked_category`")->where("email", $this->u)->where("token", $this->p)->get("users");
if ($user->num_rows() == 0) {
$this->loggedin = false;
} else {
$this->loggedin = true;
$this->info = $user->row();
if ($this->info->access_level == -1) {
$CI->load->helper("cookie");
$this->loggedin = false;
$CI->session->set_flashdata("globalmsg", "This account has been deactivated and can no longer be used.");
delete_cookie("scun");
delete_cookie("sctkn");
redirect(base_url());
} elseif ($this->info->access_level == -2) {
$CI->load->helper("cookie");
$this->loggedin = false;
$CI->session->set_flashdata("globalmsg", "This account has been BANNED and can no longer be used.");
delete_cookie("scun");
delete_cookie("sctkn");
redirect(base_url());
}
}
}
}
示例5: returnTo
function returnTo($url)
{
$this->load->helper('cookie');
$rt = get_cookie('return_to');
delete_cookie('return_to');
redirect($rt ? $rt : $url);
}
示例6: do_login
public function do_login($userinfo)
{
$this->session->unset_userdata('user');
$this->load->helper('cookie');
delete_cookie('p');
$where = array('loginname' => $userinfo['username'], 'password' => md5($userinfo['password']));
$query = $this->db->select('id, name, loginname, password, isenable')->where($where)->get('users');
if ($query->num_rows() == 1) {
$row = $query->row();
if ($row->isenable == '0') {
$this->say = array('success' => '0', 'message' => '该账户已被禁用');
} else {
$loginInfo = array('userId' => $row->id, 'userName' => $row->name);
$query = $this->db->query('select DISTINCT privilegeid from ' . $this->db->dbprefix('group_privilege') . ' where groupid in (select groupid from ' . $this->db->dbprefix('user_group') . ' where userid = ' . $row->id . ')');
//find all priivleges and write into the cookie be named 'p'
$returnPrivileges = array();
if ($query->num_rows() > 0) {
foreach ($query->result_array() as $p) {
$returnPrivileges[] = $p['privilegeid'];
}
$this->input->set_cookie('p', json_encode($returnPrivileges), 3600);
} else {
$this->input->set_cookie('p', '', 3600);
}
$this->session->user = $loginInfo;
$this->say = array('success' => '1', 'message' => $this->session->user);
}
} else {
$this->say = array('success' => '0', 'message' => '用户名密码错误');
}
return $this->say;
}
示例7: login
public function login()
{
$username = $this->input->post('username');
$password = $this->input->post('password');
$remember_check = $this->input->post('remember_check');
if (isset($remember_check)) {
set_cookie('ck_username', $username, time() + 60);
set_cookie('ck_password', $password, time() + 60);
set_cookie('ck_remember', $remember_check, time() + 60);
} else {
delete_cookie('ck_username');
delete_cookie('ck_password');
delete_cookie('ck_remember');
}
$salt = '$2a$04$123456789123456789123$';
$hashed_password = crypt($password, $salt);
$where_arr = array('admin_name' => $username, 'admin_pass' => $hashed_password);
$query = $this->db->get_where("tbl_admin", $where_arr);
$row = $query->row_array();
//คิวรี่ข้อมูลมาแสดงแค่รายการเดียว
if (isset($row)) {
$newdata = array('ses_admin_id' => $row['admin_id'], 'ses_admin_name' => $row['admin_name']);
$this->session->set_userdata($newdata);
// อัพเดทข้อมูลการล็อกอินของ admin เช่น ล็อกอินล่าสุด
$update_data = array('admin_lastlogin ' => date("Y-m-d H:i:s"));
$this->db->update('tbl_admin', $update_data, array('admin_id' => $row['admin_id']));
}
redirect('admin');
// ไปหน้า admin
}
示例8: index
public function index()
{
delete_cookie('id');
delete_cookie('key');
session_destroy();
redirect('/');
}
示例9: logout
function logout()
{
delete_cookie('key', 'localhost', '/', 'mycookie_');
delete_cookie('user', 'localhost', '/', 'mycookie_');
$this->session->sess_destroy();
redirect(site_url());
}
示例10: logout
public function logout()
{
$this->session->sess_destroy();
delete_cookie();
redirect('admin/', 'refresh');
exit;
}
示例11: admin_login_validation
public function admin_login_validation()
{
$this->form_validation->set_rules('password', 'Password', 'required|trim');
$this->form_validation->set_rules('email', 'Email', 'required|valid_email|trim|callback_validate_credentials');
if ($this->form_validation->run()) {
$data = array('email' => $this->input->post('email'), 'is_logged_in' => 1);
$this->session->set_userdata($data);
if ($this->input->post('remember') !== null) {
$cookie = array('name' => 'admin_jp_un', 'value' => $this->input->post('email'), 'expire' => time() + 100 * 24 * 60 * 60);
$this->input->set_cookie($cookie);
$cookie = array('name' => 'admin_jp_pw', 'value' => $this->input->post('password'), 'expire' => time() + 100 * 24 * 60 * 60);
$this->input->set_cookie($cookie);
} else {
delete_cookie('admin_jp_un');
delete_cookie('admin_jp_pw');
}
redirect('login/dashboard');
} else {
//echo 1; exit;
//$this->login();
//redirect('main/login');
$this->load->view('admin/login');
}
//echo $_POST['email'];
//echo $this->input->post('email');
}
示例12: view
public function view($page = 'home')
{
$this->load->model('api_model');
$this->load->database();
if (!file_exists(APPPATH . '/views/pages/' . $page . '.php')) {
// Whoops, we don't have a page for that!
die("<center><font face=tahoma><div dir=rtl>صفحه مورد نظر پیدا نشد.");
}
if ($page == "api") {
$data['title'] = ucfirst($page);
// Capitalize the first letter
$this->load->view('pages/' . $page, $data);
return;
}
$data['title'] = ucfirst($page);
// Capitalize the first letter
$this->load->view('templates/header', $data);
if (null != get_cookie("username") && null != get_cookie("password") && null != get_cookie("name") && null != get_cookie("id")) {
$u = get_cookie("username");
$p = get_cookie("password");
$query = $this->db->query("SELECT * FROM user WHERE email = '" . $u . "' AND sha1(password)='" . $p . "'");
if ($query->num_rows() < 1) {
delete_cookie("username");
}
$this->load->view('pages/' . $page, $data);
} else {
$this->load->view('pages/home-nologin', $data);
}
$this->load->view('templates/footer', $data);
}
示例13: logout
public function logout()
{
$this->session->unset_userdata('username');
$cookiedata = array('name' => 'vp_username', 'value' => '', 'expire' => 0);
delete_cookie($cookiedata);
echo 1;
}
示例14: logout
function logout()
{
unset($_SESSION['uatoken']);
delete_cookie('uatoken');
data('AUTHENTICATED', FALSE);
redirect('/site-admin/');
}
示例15: deleteToken
public function deleteToken()
{
delete_cookie(self::TOKEN_COOKIE_NAME, null, -1, '/');
if (!empty($_COOKIE[self::TOKEN_COOKIE_NAME])) {
unset($_COOKIE[self::TOKEN_COOKIE_NAME]);
}
}