Ejemplo n.º 1
0
	/**
	 * set the session object
	 *
	 * @param \OCP\ISession $session
	 */
	public function setSession(\OCP\ISession $session) {
		if ($this->session instanceof \OCP\ISession) {
			$this->session->close();
		}
		$this->session = $session;
		$this->activeUser = null;
	}
Ejemplo n.º 2
0
 /**
  * will keep the session instance in sync with \OC::$session
  * @return \OC\Session\Session
  */
 private function getSession()
 {
     //keep $this->session in sync with \OC::$session
     if ($this->session !== \OC::$session) {
         \OC::$server->getLogger()->debug('\\OC::$session has been replaced with a new instance. ' . 'Closing and replacing session in UserSession instance.');
         $this->session->close();
         $this->session = \OC::$session;
     }
     return $this->session;
 }
Ejemplo n.º 3
0
 /**
  * set the session object
  *
  * @param \OCP\ISession $session
  */
 public function setSession(\OCP\ISession $session)
 {
     if ($this->session instanceof \OCP\ISession) {
         $this->session->close();
     }
     $this->session = $session;
     // maintain deprecated \OC::$session
     if (\OC::$session !== $this->session) {
         if (\OC::$session instanceof \OCP\ISession) {
             \OC::$session->close();
         }
         \OC::$session = $session;
     }
 }
Ejemplo n.º 4
0
 public function close()
 {
     session_write_close();
     parent::close();
 }