src/ministruts/HttpSession.php
public function reset($regenerateId) {
        if (!is_bool($regenerateId)) throw new IllegalTypeException('Illegal type of parameter $regenerateId: '.gettype($regenerateId));

        if ($regenerateId) {
            // assign new id, delete old file
            session_regenerate_id(true);
        }

        // empty the session
        $this->removeAttribute(\array_keys($_SESSION));

        // initialize the session
        $request = $this->request;                                              // TODO: $request->getHeader() einbauen
        $_SESSION['__SESSION_CREATED__'  ] = microtime(true);
        $_SESSION['__SESSION_IP__'       ] = $request->getRemoteAddress();      // TODO: forwarded remote IP einbauen
        $_SESSION['__SESSION_USERAGENT__'] = $request->getHeaderValue('User-Agent');

        $this->new = true;
    }
public function reset($regenerateId) {
        if (!is_bool($regenerateId)) throw new IllegalTypeException('Illegal type of parameter $regenerateId: '.gettype($regenerateId));

        if ($regenerateId) {
            // assign new id, delete old file
            session_regenerate_id(true);
        }

        // empty the session
        $this->removeAttribute(\array_keys($_SESSION));

        // initialize the session
        $request = $this->request;                                              // TODO: $request->getHeader() einbauen
        $_SESSION['__SESSION_CREATED__'  ] = microtime(true);
        $_SESSION['__SESSION_IP__'       ] = $request->getRemoteAddress();      // TODO: forwarded remote IP einbauen
        $_SESSION['__SESSION_USERAGENT__'] = $request->getHeaderValue('User-Agent');

        $this->new = true;
    }
public function reset ( $ regenerateId ) { if ( ! is_bool ( $ regenerateId ) ) throw new IllegalTypeException ( 'Illegal type of parameter $regenerateId: ' . gettype ( $ regenerateId ) ) ; if ( $ regenerateId ) { // assign new id, delete old file session_regenerate_id ( true ) ; } // empty the session $ this -> removeAttribute ( \ array_keys ( $ _SESSION ) ) ; // initialize the session $ request = $ this -> request ; // TODO: $request->getHeader() einbauen $ _SESSION [ '__SESSION_CREATED__' ] = microtime ( true ) ; $ _SESSION [ '__SESSION_IP__' ] = $ request -> getRemoteAddress ( ) ; // TODO: forwarded remote IP einbauen $ _SESSION [ '__SESSION_USERAGENT__' ] = $ request -> getHeaderValue ( 'User-Agent' ) ; $ this -> new = true ; }
Reset this session to a clean and new state.

@param  bool $regenerateId - whether to generate a new session id and to delete an old session file
Reset this session to a clean and new state .