当前位置: 首页>>代码示例>>PHP>>正文


PHP Slim::deleteCookie方法代码示例

本文整理汇总了PHP中Slim\Slim::deleteCookie方法的典型用法代码示例。如果您正苦于以下问题:PHP Slim::deleteCookie方法的具体用法?PHP Slim::deleteCookie怎么用?PHP Slim::deleteCookie使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Slim\Slim的用法示例。


在下文中一共展示了Slim::deleteCookie方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: clear

 /**
  * Clears contents from storage
  *
  * @throws Zend_Auth_Storage_Exception If clearing contents from
  *                                     storage is impossible
  * @return void
  */
 public function clear()
 {
     $this->app->deleteCookie($this->cookieName);
 }
开发者ID:kxopa,项目名称:slim-skeleton,代码行数:11,代码来源:EncryptedCookie.php

示例2: AuthenticateFailedException

            // OK
            echo json_encode(array('operation' => 'login', 'status' => 'ok'));
        } else {
            throw new AuthenticateFailedException();
        }
    } catch (AuthenticateFailedException $e) {
        $app->response()->status(401);
        $app->response()->header('X-Status-Reason', 'Login failure');
    } catch (Exception $e) {
        $app->response()->status(400);
        $app->response()->header('X-Status-Reason', $e->getMessage());
    }
});
$app->get('/logout', function () use($app) {
    try {
        $app->deleteCookie('username');
        $app->deleteCookie('password');
        $app->response()->header('Content-Type', 'application/json');
        $app->response()->status(200);
        // OK
        echo json_encode(array('operation' => 'logout', 'status' => 'ok'));
    } catch (Exception $e) {
        $app->response()->status(400);
        $app->response()->header('X-Status-Reason', $e->getMessage());
    }
});
// API for CRUD operations on articles
// handle GET requests for /index.php/articles
$app->get('/articles', $authenticateUser($app), function () use($app) {
    // query database for all articles
    $articles = R::find('articles');
开发者ID:gsokolowski,项目名称:Php-REST-Slim-RedBean-authentication,代码行数:31,代码来源:index.php

示例3: function

            $app->flash('error', 'Too many failed attempts. Try again later.');
            $app->redirect($app->urlFor('login'));
        }
    } else {
        $app->flash('error', "All Fields Required");
        $app->redirect($app->urlFor('login'));
    }
    // END Required fields
});
// Logout page
$app->get("/logout", function () use($app, $dl) {
    // Remove the session id from the database
    // logout($username);
    unset($_SESSION['usr']);
    unset($_SESSION['sid']);
    $app->deleteCookie('urlRedirect');
    $app->view()->setData('usr', null);
    $app->flash('loggedout', 'You\'ve been logged out');
    $app->redirect($app->urlFor('login'));
});
// Temporary Admin Page
$app->get('/admin', $authenticate($app, $dl), function () use($app) {
    $app->redirect($app->urlFor('login'));
})->name('admin');
// Admin Dashboard
$app->get('/admin/dashboard', $authenticate($app, $dl), function () use($app, $dl) {
    $app->render('dashboard.twig', array('albums' => $dl->get_albums(), 'redeemed' => $dl->admin->display_emails()));
})->name('dashboard');
$app->post('/admin/dashboard', $authenticate($app, $dl), function () use($app, $dl) {
    $track_album = $app->request->post('album_codes');
    $tracks = $app->request->post('album_track');
开发者ID:nblakefriend,项目名称:download,代码行数:31,代码来源:index.php


注:本文中的Slim\Slim::deleteCookie方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。