コード例 #1
0
ファイル: WriteSession.php プロジェクト: devonzara/framework
 /**
  * Remove the garbage from the session if necessary.
  *
  * @param  \Illuminate\Session\SessionInterface  $session
  * @return void
  */
 protected function collectGarbage(SessionInterface $session)
 {
     $config = $this->manager->getSessionConfig();
     // Here we will see if this request hits the garbage collection lottery by hitting
     // the odds needed to perform garbage collection on any given request. If we do
     // hit it, we'll call this handler to let it delete all the expired sessions.
     if ($this->configHitsLottery($config)) {
         $session->getHandler()->gc($this->getSessionLifetimeInSeconds());
     }
 }
コード例 #2
0
 protected function collectGarbage(SessionInterface $session)
 {
     $config = $this->manager->getSessionConfig();
     if ($this->configHitsLottery($config)) {
         $session->getHandler()->gc($this->getSessionLifetimeInSeconds());
     }
 }