本文整理匯總了PHP中session::remove方法的典型用法代碼示例。如果您正苦於以下問題:PHP session::remove方法的具體用法?PHP session::remove怎麽用?PHP session::remove使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類session
的用法示例。
在下文中一共展示了session::remove方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: set
public function set($lang)
{
if (application::get_instance()->config->resource->lang->type != 'session') {
return false;
}
if ($lang) {
session::set('lang', $lang);
} else {
session::remove('lang');
}
setcookie($this->_key, $lang, time() + 86400 * 30, '/');
}
示例2: controller_before
public function controller_before()
{
$ml = new model_lang();
$ids = $ml->fetch_col('stitle', array('show_it' => 1));
if (@application::get_instance()->config->resource->lang->type == 'session') {
if ($ids) {
$lang_session = session::get('lang');
$lang_cookie = @$_COOKIE['lang'];
if ($lang_session && !in_array($lang_session, $ids)) {
session::remove('lang');
$lang_session = null;
}
if ($lang_cookie && !in_array($lang_cookie, $ids) || $lang_cookie && $lang_session && $lang_session != $lang_cookie) {
setcookie('lang', null, time() + 86400 * 30, '/');
}
if ($lang_cookie && !$lang_session) {
session::set('lang', $lang_cookie);
$lang_session = $lang_cookie;
}
if (application::get_instance()->config->resource->lang->detect && !$lang_session) {
$lang_detected = $this->prefered_language($ids, @$_SERVER['HTTP_ACCEPT_LANGUAGE']);
if ($lang_detected) {
session::set('lang', $lang_detected);
}
}
}
} else {
if ($ids && !in_array(application::get_instance()->controller->request->param->lang, $ids)) {
unset(application::get_instance()->controller->request->param->lang);
}
if (!application::get_instance()->controller->request->param->lang) {
application::get_instance()->controller->request->param->lang = application::get_instance()->controller->view->lang()->default->stitle;
}
if (application::get_instance()->request->url == '/control') {
header('Location: /' . application::get_instance()->controller->view->lang()->default->stitle . '/control');
exit;
} else {
if (application::get_instance()->request->url == '/error') {
header('Location: /' . application::get_instance()->controller->view->lang('stitle') . '/error');
exit;
}
}
}
}
示例3: callback
public function callback()
{
// $oauth_verifier = filter_input(INPUT_GET, 'oauth_verifier');
//
// if (empty($oauth_verifier) || empty(session::get('tw_oauth_token')) || empty(session::get('tw_oauth_secret'))) {
// // something's missing, go and login again
// header('Location: ' . tw_url_login);
// }
session::init();
$request_token = array();
$request_token['oauth_token'] = session::get('tw_oauth_token');
$request_token['oauth_token_secret'] = session::get('tw_oauth_token_secret');
// connect with application token
$connection = new TwitterOAuth(tw_consumer_key, tw_consumer_secret, $request_token['oauth_token'], $request_token['oauth_token_secret']);
// request user token
$token = $connection->oauth("oauth/access_token", array("oauth_verifier" => $_REQUEST['oauth_verifier']));
// session::set('tw_token',$token);
auth::setLogin($token, true, $db = $this->db);
session::remove('tw_oauth_token');
session::remove('tw_oauth_token_secret');
header('Location: /');
//
//
// $twitter = new TwitterOAuth(
// tw_consumer_key,
// tw_consumer_secret,
// $token['oauth_token'],
// $token['oauth_token_secret']
// );
//
// print_r($token);
//
// $result = $twitter->get('users/show', array('user_id'=>$token['user_id']));
//
// print_r($result);
//
// $status = $twitter->post(
// "statuses/update", [
// "status" => "m2m dene".date("Y-m-d h:i:sa")
// ]
// );
//
// echo ('Created new status with #' . $status->id . PHP_EOL);
}
示例4: logout
function logout()
{
if (session::get($this->_key)) {
session::remove($this->_key);
if (isset($_COOKIE[$this->_key])) {
unset($_COOKIE[$this->_key]);
setcookie($this->_key, '', 0, '/');
}
$this->_data = null;
return true;
}
return false;
}
示例5: update_clink
public function update_clink()
{
if ($this->config->field) {
foreach ($this->config->field as $k => $v) {
if ($v->type != 'clink') {
continue;
}
$class = 'model_' . $v->controller;
$s = (int) session::get($v->controller . '_clink');
if (!class_exists($class) || !$s) {
continue;
}
$m = new $class();
$m->update(array($this->config->field_map->parentid => $this->config->ok), array($this->config->field_map->parentid => $s));
session::remove($v->controller . '_clink');
}
}
}
示例6: kill
public function kill()
{
session::remove('auth');
return false;
}