本文整理汇总了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;
}
示例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;
}
示例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();
}
示例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;
}
示例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();
}
示例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();
}