A very crazy problem. It was not completed in the afternoon. Please advise that the verification code exists in the SESSION and can be written into the database, but cannot be loaded in the browser. The controller where the verification code output method is located is inherited from the BackplatformController...
A very crazy problem. I haven't finished it in the afternoon. Please advise me.
The problem is that the verification code exists in the SESSION and can be written into the database, but cannot be loaded in the browser.
The Controller of the verification code output method inherits from the BackplatformController controller,
Call the session class in the construction method of BackplatformController
The following is a custom session class.
Db = MYSQLDB: getInstance ($ GLOBALS ['config'] ['database']);}/*** close * @ return bool */public function sess_close () {return true;}/*** @ param $ sess_id * @ return string */public function sess_read ($ sess_id) {$ SQL = "select sess_data from it_session where sess_id = '$ sess_id'"; if ($ row = $ this-> db-> fetchRow ($ SQL )) {return $ row ['sess _ data'];} else {return '';}} /*** @ param $ sess_id * @ param $ sess_data */public function sess_write ($ sess_id, $ sess_data) {$ expire = time (); // If yes, update $ SQL = "insert into it_session values ('$ sess_id', '$ sess_data', '$ expire') on duplicate key update sess_data = '$ sess_data ', expire = '$ expire' "; if ($ result = $ this-> db-> myquery ($ SQL) {return true ;}} /*** @ param $ sess_id */public function sess_destroy ($ sess_id) {$ SQL = "delete from it_session where sess_id = '$ sess_id '"; $ result = $ this-> db-> myquery ($ SQL);}/*** @ param $ ttl * @ return mixed */public function sess_gc ($ ttl) {$ now = time (); $ last = $ now-$ ttl; // delete an expired session $ SQL = "delete from it_session where expire <$ last "; return $ this-> db-> myquery ($ SQL );}}
Below is the verification code stored in the session
Reply content:
A very crazy problem. I haven't finished it in the afternoon. Please advise me.
The problem is that the verification code exists in the SESSION and can be written into the database, but cannot be loaded in the browser.
The Controller of the verification code output method inherits from the BackplatformController controller,
Call the session class in the construction method of BackplatformController
The following is a custom session class.
Db = MYSQLDB: getInstance ($ GLOBALS ['config'] ['database']);}/*** close * @ return bool */public function sess_close () {return true;}/*** @ param $ sess_id * @ return string */public function sess_read ($ sess_id) {$ SQL = "select sess_data from it_session where sess_id = '$ sess_id'"; if ($ row = $ this-> db-> fetchRow ($ SQL )) {return $ row ['sess _ data'];} else {return '';}} /*** @ param $ sess_id * @ param $ sess_data */public function sess_write ($ sess_id, $ sess_data) {$ expire = time (); // If yes, update $ SQL = "insert into it_session values ('$ sess_id', '$ sess_data', '$ expire') on duplicate key update sess_data = '$ sess_data ', expire = '$ expire' "; if ($ result = $ this-> db-> myquery ($ SQL) {return true ;}} /*** @ param $ sess_id */public function sess_destroy ($ sess_id) {$ SQL = "delete from it_session where sess_id = '$ sess_id '"; $ result = $ this-> db-> myquery ($ SQL);}/*** @ param $ ttl * @ return mixed */public function sess_gc ($ ttl) {$ now = time (); $ last = $ now-$ ttl; // delete an expired session $ SQL = "delete from it_session where expire <$ last "; return $ this-> db-> myquery ($ SQL );}}
Below is the verification code stored in the session
The ob cache is not cleared.