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


PHP rcmail::setcookie方法代碼示例

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


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

示例1: regenerate_id

 public function regenerate_id()
 {
     $randval = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
     for ($random = '', $i = 1; $i <= 32; $i++) {
         $random .= substr($randval, mt_rand(0, strlen($randval) - 1), 1);
     }
     // use md5 value for id or remove capitals from string $randval
     $random = md5($random);
     // delete old session record
     $this->destroy(session_id());
     session_id($random);
     $cookie = session_get_cookie_params();
     $lifetime = $cookie['lifetime'] ? time() + $cookie['lifetime'] : 0;
     rcmail::setcookie(session_name(), $random, $lifetime);
     return true;
 }
開發者ID:shishenkov,項目名稱:zpanel,代碼行數:16,代碼來源:rcube_session.php

示例2: logout

 function logout($args)
 {
     $this->add_texts('localization/');
     $rcmail = rcmail::get_instance();
     if ($rcmail->task == "logout" && isset($_COOKIE['rememberme_user']) && isset($_COOKIE['rememberme_pass'])) {
         if (!isset($_POST['_remember_me'])) {
             if (!isset($_GET['_remember_me'])) {
                 $rcmail->output->send("remember_me.remember_me");
             } else {
                 $rcmail->output->show_message("remember_me.close");
                 $rcmail->output->send("remember_me.redirect");
                 exit;
             }
         } else {
             rcmail::setcookie('rememberme_user', '', time() - 3600);
             rcmail::setcookie('rememberme_pass', '', time() - 3600);
             rcmail::setcookie('rememberme_host', '', time() - 3600);
             rcmail::setcookie('rememberme_checked', '', time() - 3600);
             rcmail::setcookie('rememberme_timezone', '', time() - 3600);
             unset($_COOKIE['rememberme_checked']);
             header('Location: ./?_task=logout');
             exit;
         }
     }
     return $args;
 }
開發者ID:BillTheBest,項目名稱:1.6.x,代碼行數:26,代碼來源:remember_me.php

示例3: kill_session

 /**
  * Destroy session data and remove cookie
  */
 public function kill_session()
 {
     $_SESSION = array('language' => $this->user->language, 'auth_time' => time(), 'temp' => true);
     rcmail::setcookie('sessauth', '-del-', time() - 60);
     $this->user->reset();
 }
開發者ID:jin255ff,項目名稱:company_website,代碼行數:9,代碼來源:rcmail.php

示例4: set_auth_cookie

 /**
  * Set session authentication cookie
  */
 function set_auth_cookie()
 {
     $this->cookie = $this->_mkcookie($this->now);
     rcmail::setcookie($this->cookiename, $this->cookie, 0);
     $_COOKIE[$this->cookiename] = $this->cookie;
 }
開發者ID:CDN-Sparks,項目名稱:owncloud,代碼行數:9,代碼來源:rcube_session.php

示例5: kill_session

 /**
  * Destroy session data and remove cookie
  */
 public function kill_session()
 {
     $this->plugins->exec_hook('session_destroy');
     $this->session->remove();
     $_SESSION = array('language' => $this->user->language, 'auth_time' => time(), 'temp' => true);
     rcmail::setcookie('sessauth', '-del-', time() - 60);
     $this->user->reset();
 }
開發者ID:shishenkov,項目名稱:zpanel,代碼行數:11,代碼來源:rcmail.php

示例6: kill_session

 /**
  * Destroy session data and remove cookie
  */
 public function kill_session()
 {
     $this->plugins->exec_hook('kill_session');
     rcube_sess_unset();
     if (!isset($_SESSION['elastix_user'])) {
         $_SESSION = array('language' => $USER->language, 'auth_time' => time(), 'temp' => true);
     } else {
         $_SESSION['language'] = $USER->language;
         $_SESSION['auth_time'] = time();
         $_SESSION['temp'] = true;
         foreach (array('temp', 'user_id', 'username', 'imap_host', 'imap_port', 'imap_ssl', 'password', 'login_time', 'mbox', 'sort_col', 'sort_order', 'quota_display') as $k) {
             unset($_SESSION[$k]);
         }
     }
     rcmail::setcookie('sessauth', '-del-', time() - 60);
     $this->user->reset();
 }
開發者ID:hardikk,項目名稱:HNH,代碼行數:20,代碼來源:rcmail.php


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