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


PHP session::delete方法代碼示例

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


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

示例1: action_logout

 /**
  * завершает сессию пользователя
  */
 public function action_logout()
 {
     session::delete('uid');
     setcookie('uid', '', time() - 360000, '/');
     setcookie('username', '', time() + 60 * 60 * 24 * 30, '/');
     $this->_actions_data['_ok'] = 1;
 }
開發者ID:romancient,項目名稱:php-testtask,代碼行數:10,代碼來源:user.php

示例2: oauth_logout

function oauth_logout()
{
    unset($_SESSION["state"]);
    unset($_SESSION["URI"]);
    $session = new session();
    $session->delete('oauth_data');
}
開發者ID:rainbow88,項目名稱:hummel,代碼行數:7,代碼來源:qq.php

示例3: logout

 function logout()
 {
     global $CONF, $LNG, $TMPL;
     require_once "{$CONF['path']}/sources/misc/session.php";
     $session = new session();
     $session->delete($_COOKIE['atsphp_sid_user_cp']);
     $TMPL['content'] = $LNG['user_cp_logout_message'];
 }
開發者ID:BackupTheBerlios,項目名稱:atsphp-svn,代碼行數:8,代碼來源:user_cpl.php

示例4: check

 public static function check($token)
 {
     $tokenName = TOKEN_NAME;
     if (session::exist($tokenName) && $token === session::get($tokenName)) {
         session::delete($tokenName);
         return TRUE;
     }
     return FALSE;
 }
開發者ID:kronxblue,項目名稱:1stg,代碼行數:9,代碼來源:token.php

示例5: check

 public static function check($token)
 {
     $tokenName = config::get('session/token_name');
     if (session::exists($tokenName) && $token === session::get($tokenName)) {
         session::delete($tokenName);
         return true;
     }
     return false;
 }
開發者ID:pediredla,項目名稱:SocialNetwork,代碼行數:9,代碼來源:token.php

示例6: checkPass

function checkPass($chave)
{
    session::delete('id_user');
    if (!Access::where('accesskey', $chave)->exists()) {
        return true;
    } else {
        $a = Access::where('accesskey', $chave)->get();
        session::set('id_user', $a[0]->id_user);
        return false;
    }
}
開發者ID:avneto,項目名稱:painelAdministrativo,代碼行數:11,代碼來源:UserController.php

示例7: check

 function check($username)
 {
     global $CONF, $FORM;
     require_once "{$CONF['path']}/sources/misc/session.php";
     $session = new session();
     list($type, $data) = $session->get($FORM['sid']);
     $session->delete($FORM['sid']);
     if ($type == 'gateway' && $data == $username) {
         return 1;
     } else {
         return 0;
     }
 }
開發者ID:Kheros,項目名稱:MMOver,代碼行數:13,代碼來源:in.php

示例8: saveSetting

 public function saveSetting($plugin, $keyword, $value, $orderID = false)
 {
     $data = array('val' => $value);
     if ($orderID !== false) {
         $data['order_id'] = $orderID;
     }
     $retval = $this->db->update('core_config', $data, array('plugin' => $plugin, 'keyword' => $keyword), 1);
     if ($retval) {
         // Action hook
         hook::action('system/settings/update', $plugin, $keyword, $value, $orderID);
     }
     session::delete('', 'config');
     $this->cache->cleanup();
     return $retval;
 }
開發者ID:soremi,項目名稱:tutornavi,代碼行數:15,代碼來源:config.php

示例9: session

 function new_password()
 {
     global $CONF, $DB, $FORM, $LNG, $TMPL;
     require_once "{$CONF['path']}/sources/misc/session.php";
     $session = new session();
     list($type, $data) = $session->get($FORM['sid']);
     $TMPL['username'] = $DB->escape($data);
     $password = md5($FORM['password']);
     if ($type == 'lost_pw') {
         $session->delete($FORM['sid']);
         $DB->query("UPDATE {$CONF['sql_prefix']}_sites SET password = '{$password}' WHERE username = '{$TMPL['username']}'", __FILE__, __LINE__);
         $TMPL['content'] = $this->do_skin('lost_pw_finish_2');
     } else {
         $this->error($LNG['g_session_expired']);
     }
 }
開發者ID:BackupTheBerlios,項目名稱:atsphp-svn,代碼行數:16,代碼來源:lost_pw.php

示例10: delete

 public static function delete($id)
 {
     session::delete("capcha_{$id}");
 }
開發者ID:reang,項目名稱:Dingo-Framework,代碼行數:4,代碼來源:capcha.php

示例11: isset

 function check_input($type)
 {
     global $CONF, $DB, $FORM, $LNG, $TMPL;
     $error_username = 0;
     $error_username_duplicate = 0;
     $error_password = 0;
     $error_confirm_password = 0;
     $error_url = 0;
     $error_email = 0;
     $error_title = 0;
     $error_banner_url = 0;
     $error_captcha = 0;
     $error_security_question = 0;
     // Filter the URL using a regex I found here: http://www.manamplified.org/archives/000318.html
     preg_match('/[A-Za-z][A-Za-z0-9+.-]{1,120}:[A-Za-z0-9\\/](([A-Za-z0-9$_.+!*,;\\/?:@&~=-])|%[A-Fa-f0-9]{2}){1,333}(#([a-zA-Z0-9][a-zA-Z0-9$_.+!*,;\\/?:@&~=%-]{0,1000}))?/', $TMPL['url'], $matches);
     $TMPL['url'] = isset($matches[0]) ? $matches[0] : $TMPL['url'];
     preg_match('/[A-Za-z][A-Za-z0-9+.-]{1,120}:[A-Za-z0-9\\/](([A-Za-z0-9$_.+!*,;\\/?:@&~=-])|%[A-Fa-f0-9]{2}){1,333}(#([a-zA-Z0-9][a-zA-Z0-9$_.+!*,;\\/?:@&~=%-]{0,1000}))?/', $TMPL['banner_url'], $matches);
     $TMPL['banner_url'] = isset($matches[0]) ? $matches[0] : $TMPL['banner_url'];
     if ($type == 'join') {
         if (!preg_match('/^[a-zA-Z0-9\\-_]+$/', $FORM['u'])) {
             $error_username = 1;
         }
         list($username_sql) = $DB->fetch("SELECT username FROM {$CONF['sql_prefix']}_sites WHERE username = '{$TMPL['username']}'", __FILE__, __LINE__);
         if ($username_sql && $username_sql == $TMPL['username']) {
             $error_username_duplicate = 1;
         }
         if (!$FORM['password']) {
             $error_password = 1;
         }
         if ($FORM['password'] != $FORM['confirm_password']) {
             $error_confirm_password = 1;
         }
         if ($CONF['captcha']) {
             $ip = $DB->escape($_SERVER['REMOTE_ADDR'], 1);
             list($sid) = $DB->fetch("SELECT sid FROM {$CONF['sql_prefix']}_sessions WHERE type = 'captcha' AND data LIKE '{$ip}|%'", __FILE__, __LINE__);
             require_once "{$CONF['path']}/sources/misc/session.php";
             $session = new session();
             list($type, $data) = $session->get($sid);
             list($ip, $hash) = explode('|', $data);
             if (!isset($FORM['captcha']) || $hash != sha1(')F*RJ@FHR^%X' . $FORM['captcha'] . '(*Ht3h7f9&^F' . $ip)) {
                 $error_captcha = 1;
             }
             $session->delete($sid);
         }
         if ($CONF['security_question'] && $CONF['security_answer']) {
             if ($FORM['security_answer'] != $CONF['security_answer']) {
                 $error_security_question = 1;
             }
         }
     }
     if (!preg_match('/^https?:\\/\\/.+/', $TMPL['url'])) {
         $error_url = 1;
     }
     if (!preg_match('/^([a-zA-Z0-9])+([a-zA-Z0-9._-])*@([a-zA-Z0-9_-])+([a-zA-Z0-9._-]+)+$/', $TMPL['email'])) {
         $error_email = 1;
     }
     if (!$TMPL['title']) {
         $error_title = 1;
     }
     if (!preg_match('/^https?:\\/\\/.+/', $TMPL['banner_url'])) {
         $TMPL['banner_url'] = $CONF['default_banner'];
     } elseif ($CONF['max_banner_width'] && $CONF['max_banner_height'] && ini_get('allow_url_fopen')) {
         $size = getimagesize($FORM['banner_url']);
         if ($size[0] > $CONF['max_banner_width'] || $size[1] > $CONF['max_banner_height']) {
             $error_banner_url = 1;
         }
         if (!isset($size[0]) && !isset($size[1])) {
             $error_banner_url = 1;
         }
     }
     $good_cat = 0;
     foreach ($CONF['categories'] as $cat => $skin) {
         if ($TMPL['category'] == $cat) {
             $good_cat = 1;
         }
     }
     if (!$good_cat) {
         $TMPL['category'] = $cat;
     }
     if ($error_username || $error_username_duplicate || $error_password || $error_confirm_password || $error_url || $error_email || $error_title || $error_banner_url || $error_captcha || $error_security_question) {
         if ($error_username) {
             $TMPL['error_username'] = "<br />{$LNG['join_error_username']}";
             $TMPL['error_style_username'] = 'join_edit_error';
         }
         if ($error_username_duplicate) {
             $TMPL['error_username'] = "<br />{$LNG['join_error_username_duplicate']}";
             $TMPL['error_style_username'] = 'join_edit_error';
         }
         $TMPL['error_password'] = "<br />{$LNG['join_error_password']}";
         $TMPL['error_style_password'] = 'join_edit_error';
         if ($error_confirm_password) {
             $TMPL['error_password'] = "<br />{$LNG['join_error_confirm_password']}";
         }
         if ($error_url) {
             $TMPL['error_url'] .= "<br />{$LNG['join_error_url']}";
             $TMPL['error_style_url'] = 'join_edit_error';
         }
         if ($error_email) {
             $TMPL['error_email'] .= "<br />{$LNG['join_error_email']}";
             $TMPL['error_style_email'] = 'join_edit_error';
//.........這裏部分代碼省略.........
開發者ID:BackupTheBerlios,項目名稱:atsphp-svn,代碼行數:101,代碼來源:classes.php

示例12: session_delete

function session_delete($name)
{
    return session::delete($name);
}
開發者ID:samplecms,項目名稱:package,代碼行數:4,代碼來源:_function.php

示例13: uninstall

 public function uninstall($templateID, $template)
 {
     // Delete template
     $retval = $this->db->delete('core_templates', array('template_id' => $templateID), 1);
     if ($retval) {
         // Update users with the new system template ID
         $this->db->update('users', array('template_id' => config::item('template_id', 'system')), array('template_id' => $templateID));
         if ($templateID == session::item('template_id')) {
             session::delete('', 'config');
         }
         // Action hook
         hook::action('system/templates/uninstall', $templateID, $template);
         $this->cache->cleanup();
     }
     return $retval;
 }
開發者ID:soremi,項目名稱:tutornavi,代碼行數:16,代碼來源:templates.php

示例14: logout

 public function logout()
 {
     $this->_database->delete('User_session', array('UserID', '=', $this->data()->UserID));
     session::delete($this->_sessionName);
     cookie::delete($this->_cookieName);
 }
開發者ID:pediredla,項目名稱:SocialNetwork,代碼行數:6,代碼來源:user.php

示例15: logout

 public function logout()
 {
     $this->_db->delete('users_session', array('user_id', '=', $this->data()->id));
     session::delete($this->_sessionName);
     cookie::delete($this->_cookieName);
 }
開發者ID:hatemali510,項目名稱:carservice,代碼行數:6,代碼來源:user.php


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