src/Persist.php
public function trashCollect()
    {
        $this->debug->groupCollapsed(__METHOD__);
        // $cfg = $this->cfg;
        $tsNow = \microtime(true);
        // $this->debug->log('this->data', $this->data);
        if (isset($_SESSION['form_persist']) && \is_array($_SESSION['form_persist'])) {
            foreach ($_SESSION['form_persist'] as $formName => $data) {
                if (!isset($data['ver'])) {
                    continue;
                }
                $tsDiff = $tsNow - $data['timestamp'];
                $this->debug->log($formName.' created '.\number_format($tsDiff, 4).' sec ago');
                // && ( empty($_SERVER['HTTP_USER_AGENT']) || \strpos($_SERVER['HTTP_USER_AGENT'], 'Safari') )
                /*
                primarily a Safari issue
                <img src="" />, imgNode.setAttribute('src', ''), etc
                will get interepreted as <img src=" {request_uri} " />...
                these requests can be seen in the browser's development console and network requests as
                "Resource interpreted as Image but transferred with MIME type text/html."
                which will effectevely come in as a GET request after the page is loaded.
                this GET request will end up here triggering trash collection!!
                */
                $remove = false;
                if (isset($this->data['name']) && $formName == $this->data['name']) {
                    $this->debug->warn('not trashing current form');
                    continue;
                } elseif ($data['trashCollectable'] && $tsDiff > 10) {
                    $remove = true;
                }
                if ($remove) {
                    $this->debug->warn('removing', $formName);
                    $this->trashCollectFiles($data);
                    unset($_SESSION['form_persist'][$formName]);
                }
            }
        }
        if (empty($_SESSION['form_persist'])) {
            unset($_SESSION['form_persist']);
        }
        $this->debug->groupEnd();
    }
public function trashCollect()
    {
        $this->debug->groupCollapsed(__METHOD__);
        // $cfg = $this->cfg;
        $tsNow = \microtime(true);
        // $this->debug->log('this->data', $this->data);
        if (isset($_SESSION['form_persist']) && \is_array($_SESSION['form_persist'])) {
            foreach ($_SESSION['form_persist'] as $formName => $data) {
                if (!isset($data['ver'])) {
                    continue;
                }
                $tsDiff = $tsNow - $data['timestamp'];
                $this->debug->log($formName.' created '.\number_format($tsDiff, 4).' sec ago');
                // && ( empty($_SERVER['HTTP_USER_AGENT']) || \strpos($_SERVER['HTTP_USER_AGENT'], 'Safari') )
                /*
                primarily a Safari issue
                <img src="" />, imgNode.setAttribute('src', ''), etc
                will get interepreted as <img src=" {request_uri} " />...
                these requests can be seen in the browser's development console and network requests as
                "Resource interpreted as Image but transferred with MIME type text/html."
                which will effectevely come in as a GET request after the page is loaded.
                this GET request will end up here triggering trash collection!!
                */
                $remove = false;
                if (isset($this->data['name']) && $formName == $this->data['name']) {
                    $this->debug->warn('not trashing current form');
                    continue;
                } elseif ($data['trashCollectable'] && $tsDiff > 10) {
                    $remove = true;
                }
                if ($remove) {
                    $this->debug->warn('removing', $formName);
                    $this->trashCollectFiles($data);
                    unset($_SESSION['form_persist'][$formName]);
                }
            }
        }
        if (empty($_SESSION['form_persist'])) {
            unset($_SESSION['form_persist']);
        }
        $this->debug->groupEnd();
    }
public function trashCollect ( ) { $ this -> debug -> groupCollapsed ( __METHOD__ ) ; // $cfg = $this->cfg; $ tsNow = \ microtime ( true ) ; // $this->debug->log('this->data', $this->data); if ( isset ( $ _SESSION [ 'form_persist' ] ) && \ is_array ( $ _SESSION [ 'form_persist' ] ) ) { foreach ( $ _SESSION [ 'form_persist' ] as $ formName => $ data ) { if ( ! isset ( $ data [ 'ver' ] ) ) { continue ; } $ tsDiff = $ tsNow - $ data [ 'timestamp' ] ; $ this -> debug -> log ( $ formName . ' created ' . \ number_format ( $ tsDiff , 4 ) . ' sec ago' ) ; // && ( empty($_SERVER['HTTP_USER_AGENT']) || \strpos($_SERVER['HTTP_USER_AGENT'], 'Safari') ) /*
                primarily a Safari issue
                <img src="" />, imgNode.setAttribute('src', ''), etc
                will get interepreted as <img src=" {request_uri} " />...
                these requests can be seen in the browser's development console and network requests as
                "Resource interpreted as Image but transferred with MIME type text/html."
                which will effectevely come in as a GET request after the page is loaded.
                this GET request will end up here triggering trash collection!!
                */ $ remove = false ; if ( isset ( $ this -> data [ 'name' ] ) && $ formName == $ this -> data [ 'name' ] ) { $ this -> debug -> warn ( 'not trashing current form' ) ; continue ; } elseif ( $ data [ 'trashCollectable' ] && $ tsDiff > 10 ) { $ remove = true ; } if ( $ remove ) { $ this -> debug -> warn ( 'removing' , $ formName ) ; $ this -> trashCollectFiles ( $ data ) ; unset ( $ _SESSION [ 'form_persist' ] [ $ formName ] ) ; } } } if ( empty ( $ _SESSION [ 'form_persist' ] ) ) { unset ( $ _SESSION [ 'form_persist' ] ) ; } $ this -> debug -> groupEnd ( ) ; }
Remove session data

@return void
Remove session data