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