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


PHP SessionInterface::clear方法代码示例

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


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

示例1: buildClient

 /**
  * Build client
  *
  * @return $this Self object
  */
 public function buildClient()
 {
     $this->kernel = new \AppKernel('test', false);
     $this->kernel->boot();
     $this->session->clear();
     $this->client = $this->kernel->getContainer()->get('test.client');
     $this->environmentBuilder->setUp($this->kernel);
 }
开发者ID:jverdeyen-forks,项目名称:VisithorBundle,代码行数:13,代码来源:SymfonyClient.php

示例2: invalidate

 /**
  * Invalidates the session
  *
  * Deletes session data and session persistence. Starts a new session.
  *
  * @return boolean
  * @since 1.9
  */
 public function invalidate()
 {
     $this->storage->clear();
     $this->logged_in_user = null;
     $result = $this->migrate(true);
     $this->generateSessionToken();
     return $result;
 }
开发者ID:elgg,项目名称:elgg,代码行数:16,代码来源:ElggSession.php

示例3: testClear

 /**
  * @dataProvider setProvider
  */
 public function testClear($key, $value)
 {
     $this->session->set('hi', 'fabien');
     $this->session->set($key, $value);
     $this->session->clear();
     $this->assertEquals(array(), $this->session->all());
 }
开发者ID:manhvu1212,项目名称:videoplatform,代码行数:10,代码来源:SessionTest.php

示例4: process

 /**
  * @param SessionInterface $session
  * @param Request          $request
  *
  * @return void
  */
 public function process(SessionInterface $session, Request $request)
 {
     $variants = $session->get(self::SESSION_PARAM_VARIANTS);
     $this->resultManager->loadVariants($variants);
     $this->resultManager->setQuiz($this->quiz);
     $this->result = $this->resultManager->createDiagnosis();
     if (!$session->has(self::SESSION_PARAM_RESULT_SAVED)) {
         $session->set(self::SESSION_PARAM_RESULT_SAVED, true);
         $this->resultManager->saveResult();
     }
     if ($request->request->has($this->getId())) {
         $session->clear();
         $this->completed = true;
     }
 }
开发者ID:rsmakota,项目名称:ortofit,代码行数:21,代码来源:StateResult.php

示例5: onLogout

 /**
  * Wordpress user log out hook method
  *
  * @param WordpressEvent $event
  *
  * @see http://codex.wordpress.org/Plugin_API/Action_Reference/wp_logout
  */
 public function onLogout(WordpressEvent $event)
 {
     $this->session->clear();
     $this->tokenStorage->setToken(null);
 }
开发者ID:eko,项目名称:EkinoWordpressBundle,代码行数:12,代码来源:UserHookListener.php

示例6: onLogout

 /**
  * Wordpress user log out hook method
  *
  * @param WordpressEvent $event
  *
  * @see http://codex.wordpress.org/Plugin_API/Action_Reference/wp_logout
  */
 public function onLogout(WordpressEvent $event)
 {
     $this->session->clear();
     $this->securityContext->setToken(null);
 }
开发者ID:carboncreative,项目名称:EkinoWordpressBundle,代码行数:12,代码来源:UserHookListener.php


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