本文整理汇总了PHP中fSession::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP fSession::delete方法的具体用法?PHP fSession::delete怎么用?PHP fSession::delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类fSession
的用法示例。
在下文中一共展示了fSession::delete方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testDelete
public function testDelete()
{
fSession::open();
$_SESSION['delete'] = TRUE;
fSession::delete('delete');
$this->assertEquals(FALSE, isset($_SESSION['delete']));
}
示例2: retrieve
/**
* Retrieves and removes a message from the session
*
* @param string $name The name of the message to retrieve
* @param string $recipient The intended recipient
* @return string The message contents
*/
public static function retrieve($name, $recipient = NULL)
{
if ($recipient === NULL) {
$recipient = '{default}';
}
$key = __CLASS__ . '::' . $recipient . '::' . $name;
$message = fSession::get($key, NULL);
fSession::delete($key);
return $message;
}
示例3: getRequestedURL
/**
* Returns the URL requested before the user was redirected to the login page
*
* @param boolean $clear If the requested url should be cleared from the session after it is retrieved
* @param string $default_url The default URL to return if the user was not redirected
* @return string The URL that was requested before they were redirected to the login page
*/
public static function getRequestedURL($clear, $default_url = NULL)
{
$requested_url = fSession::get(__CLASS__ . '::requested_url', $default_url);
if ($clear) {
fSession::delete(__CLASS__ . '::requested_url');
}
return $requested_url;
}
示例4:
$errmsg = '';
if (fRequest::isPost()) {
$old_password = fRequest::get('old-password');
$new_password = fRequest::get('new-password');
$confirm_password = fRequest::get('confirm-password');
$token = fAuthorization::getUserToken();
$username = $token['name'];
$user_id = $token['id'];
if (empty($old_password) or empty($new_password) or empty($confirm_password)) {
$errmsg = '密码不能为空';
} else {
if ($new_password != $confirm_password) {
$errmsg = '两次输入的新密码不一致';
} else {
if (login_check_credential($db, $username, $old_password) == false) {
$errmsg = '旧密码错误';
} else {
if (login_change_password($db, $user_id, $new_password)) {
fURL::redirect(fSession::delete('change-password-referer', SITE_BASE));
} else {
$errmsg = '修改密码失败';
}
}
}
}
} else {
if (fSession::get('change-password-referer') == null) {
fSession::set('change-password-referer', login_get_referer(SITE_BASE));
}
}
include __DIR__ . '/tpl/change-password.php';
示例5: testDeleteNestedArraySyntax
public function testDeleteNestedArraySyntax()
{
fSession::open();
$_SESSION['delete'] = array('foo' => array('bar' => 'baz'));
$this->assertEquals('baz', fSession::delete('delete[foo][bar]'));
$this->assertEquals(array('foo' => array()), $_SESSION['delete']);
}