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}"); }
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); }
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(); }
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. } } }
/** * 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'); }
/** * {@inheritDoc} */ public function hasChanged() : bool { return $this->realSession && $this->realSession->hasChanged(); }
public function __construct(UserProvider $userProvider, SessionInterface $session) { $this->_userProvider = $userProvider; $this->_user = $session->getUser(); $this->_session = $session; }
/** * 彻底删除SESSION * @return void */ public function destroy() { $this->drive->destroy(); }
/** * ArrayAccess Interface implementation: Sets an index * * @param string $offset * @param mixed $value * @return void */ public function offsetSet($offset, $value) { $this->session->offsetSet($offset, $value); }