当前位置: 首页>>代码示例>>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;未经允许,请勿转载。