Esempio n. 1
0
 public static function destroy($sess_id)
 {
     // Perform standard actions required by all session methods:
     parent::destroy($sess_id);
     // Perform Memcache-specific cleanup:
     return self::$connection->delete("vufind_sessions/{$sess_id}");
 }
Esempio n. 2
0
 public static function destroy($sess_id)
 {
     // Perform standard actions required by all session methods:
     parent::destroy($sess_id);
     // Perform file-specific cleanup:
     $sess_file = self::$path . '/sess_' . $sess_id;
     return @unlink($sess_file);
 }
Esempio n. 3
0
 public static function destroy($sess_id)
 {
     // Perform standard actions required by all session methods:
     parent::destroy($sess_id);
     // Now do database-specific destruction:
     $s = new Session();
     $s->session_id = $sess_id;
     return $s->delete();
 }
Esempio n. 4
0
 public function init($lt, $rememberMeLifetime)
 {
     self::$lifetime = $lt;
     self::$rememberMeLifetime = $rememberMeLifetime;
     session_set_save_handler(array(get_class($this), 'open'), array(get_class($this), 'close'), array(get_class($this), 'read'), array(get_class($this), 'write'), array(get_class($this), 'destroy'), array(get_class($this), 'gc'));
     //Have to set the default timeout before we call session start, set a really long timeout by default since PHP doesn't like to extend the PHPSESSION timeout
     //Set one year by default
     session_set_cookie_params(0, '/');
     session_start();
 }
 /**
  * @dataProvider provideRemove
  */
 public function testRemove($path, $expectedRemovedPaths)
 {
     $expectedNbRemoved = count($expectedRemovedPaths);
     $nbRemoved = $this->getRepository()->remove($path);
     $this->assertEquals($expectedNbRemoved, $nbRemoved);
     foreach ($expectedRemovedPaths as $path) {
         try {
             $this->session->getNode($path);
             $this->fail('Node at "%s" still exists');
         } catch (PathNotFoundException $e) {
             // ok then.
         }
     }
 }
Esempio n. 6
0
 /**
  * Initialize the session handler.
  *
  * @param int $lt Session lifetime (in seconds)
  *
  * @return void
  * @access public
  */
 public function init($lt)
 {
     global $configArray;
     self::$lifetime = $lt;
     session_set_save_handler(array(get_class($this), 'open'), array(get_class($this), 'close'), array(get_class($this), 'read'), array(get_class($this), 'write'), array(get_class($this), 'destroy'), array(get_class($this), 'gc'));
     $sitePath = '/';
     if (isset($configArray['Session']['limit_session_path']) && $configArray['Session']['limit_session_path']) {
         $sitePath = $configArray['Site']['path'] ? $configArray['Site']['path'] : '/';
     }
     $useSecure = isset($configArray['Site']['useHttps']) && $configArray['Site']['useHttps'];
     session_set_cookie_params(0, $sitePath, '', $useSecure);
     session_start();
     // According to the PHP manual, session_write_close should always be
     // registered as a shutdown function when using an object as a session
     // handler: http://us.php.net/manual/en/function.session-set-save-handler.php
     register_shutdown_function('session_write_close');
 }
Esempio n. 7
0
 /**
  * {@inheritDoc}
  */
 public function hasChanged() : bool
 {
     return $this->realSession && $this->realSession->hasChanged();
 }
Esempio n. 8
0
 public function __construct(UserProvider $userProvider, SessionInterface $session)
 {
     $this->_userProvider = $userProvider;
     $this->_user = $session->getUser();
     $this->_session = $session;
 }
Esempio n. 9
0
 /**
  * 彻底删除SESSION
  * @return void
  */
 public function destroy()
 {
     $this->drive->destroy();
 }
Esempio n. 10
0
 /**
  * ArrayAccess Interface implementation: Sets an index
  *
  * @param  string  $offset
  * @param  mixed   $value
  * @return void
  */
 public function offsetSet($offset, $value)
 {
     $this->session->offsetSet($offset, $value);
 }