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


PHP SessionInterface::migrate方法代码示例

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


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

示例1: revokeSession

 /**
  * Log out the currently logged in user.
  *
  * @return boolean
  */
 public function revokeSession()
 {
     $this->flashLogger->info(Trans::__('You have been logged out.'));
     // Remove all auth tokens when logging off a user
     if ($sessionAuth = $this->session->get('authentication')) {
         $this->repositoryAuthtoken->deleteTokens($sessionAuth->getUser()->getUsername());
     }
     $this->session->remove('authentication');
     $this->session->migrate(true);
     return false;
 }
开发者ID:zomars,项目名称:bolt,代码行数:16,代码来源:AccessChecker.php

示例2: revokeSession

 /**
  * Log out the currently logged in user.
  *
  * @return boolean
  */
 public function revokeSession()
 {
     try {
         // Only show this flash if there are users in the system.
         // Not when we're about to get redirected to the "first users" screen.
         if ($this->repositoryUsers->hasUsers()) {
             $this->flashLogger->info(Trans::__('You have been logged out.'));
         }
     } catch (TableNotFoundException $e) {
         // If we have no table, then we definitely have no users
     }
     // Remove all auth tokens when logging off a user
     if ($sessionAuth = $this->session->get('authentication')) {
         $this->repositoryAuthtoken->deleteTokens($sessionAuth->getUser()->getUsername());
     }
     $this->session->remove('authentication');
     $this->session->migrate(true);
     return false;
 }
开发者ID:Boorj,项目名称:bolt,代码行数:24,代码来源:AccessChecker.php

示例3: testMigrateDestroy

 public function testMigrateDestroy()
 {
     $this->session->set('migrate', 333);
     $this->session->migrate(true);
     $this->assertEquals(333, $this->session->get('migrate'));
 }
开发者ID:manhvu1212,项目名称:videoplatform,代码行数:6,代码来源:SessionTest.php

示例4: updateSession

 /**
  * Update the session with the given ID.
  *
  * @param  string  $id
  * @return void
  */
 protected function updateSession($id)
 {
     $this->session->set($this->getName(), $id);
     $this->session->migrate(true);
 }
开发者ID:maherelgamil,项目名称:Small-store-for-books-with-Laravel-5.1,代码行数:11,代码来源:Guard.php

示例5: login

 /**
  * Log an user into the application.
  *
  * @param UserInterface $user
  * @return Response
  */
 public function login(UserInterface $user)
 {
     $this->session->migrate();
     $this->setUser($user);
     return $this->events->dispatch(AuthEvents::LOGIN, new LoginEvent($user))->getResponse();
 }
开发者ID:jacobjjc,项目名称:PageKit-framework,代码行数:12,代码来源:Auth.php

示例6: migrate

 /**
  * Migrates the session to a new session id while maintaining session attributes
  *
  * @param boolean $destroy Whether to delete the session or let gc handle clean up
  * @return boolean
  * @since 1.9
  */
 public function migrate($destroy = false)
 {
     return $this->storage->migrate($destroy);
 }
开发者ID:elgg,项目名称:elgg,代码行数:11,代码来源:ElggSession.php

示例7: migrate

 /**
  * Migrates the current session to a new session id while maintaining all
  * session attributes.
  */
 public function migrate()
 {
     $this->session->migrate();
 }
开发者ID:eefjevanderharst,项目名称:Stepup-SelfService,代码行数:8,代码来源:SessionHandler.php

示例8: logIn

 /**
  * @param SessionInterface $session
  * @param int $userId
  */
 public function logIn(SessionInterface $session, $userId)
 {
     $session->migrate();
     $session->set('user_id', $userId);
 }
开发者ID:Luceos,项目名称:core,代码行数:9,代码来源:SessionAuthenticator.php

示例9: migrate

 /**
  * Migrate session
  *
  * @param bool $destroy
  * @param null $lifetime
  */
 public function migrate($destroy = false, $lifetime = null)
 {
     $this->session->migrate($destroy, $lifetime);
 }
开发者ID:andrewkrug,项目名称:repucaution,代码行数:10,代码来源:Session.php

示例10: handleLogin

 /**
  * @param SessionInterface $session
  * @param AuthenticationDataVO $authenticationVo
  * @param UserVO $userVo
  * @return AuthenticateUserEvent
  */
 private function handleLogin(SessionInterface $session, AuthenticationDataVO $authenticationVo, UserVO $userVo)
 {
     $event = new AuthenticateUserEvent($authenticationVo, AuthenticateUserEvent::CHECK);
     $this->dispatchEvent($event);
     $session->set('user_id', $userVo->id);
     // renew session-id to prevent session fixation
     $session->migrate();
     $event = new AuthenticateUserEvent($authenticationVo, AuthenticateUserEvent::AUTHENTICATED);
     $this->dispatchEvent($event);
 }
开发者ID:brainexe,项目名称:core,代码行数:16,代码来源:Login.php

示例11: logIn

 /**
  * @param SessionInterface $session
  * @param int $userId
  */
 public function logIn(SessionInterface $session, $userId)
 {
     $session->migrate();
     $session->set('user_id', $userId);
     $session->set('sudo_expiry', new DateTime('+30 minutes'));
 }
开发者ID:asifalimd,项目名称:core,代码行数:10,代码来源:SessionAuthenticator.php


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