A very crazy problem, engaged in an afternoon did not fix, please master advice
The problem is that the verification code exists in the session and can be written into the database, but it cannot be loaded in the browser.
The controller that the verification code output method resides in inherits from the Backplatformcontroller controller,
The session class is called in the Backplatformcontroller constructor method.
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 ses S_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 (); Presence is updated $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 expired Session $sql = "Delete from it_session where expire < $last"; return $this->db->myquery ($sql); }}
Here is the verification code stored in session
Reply content:
A very crazy problem, engaged in an afternoon did not fix, please master advice
The problem is that the verification code exists in the session and can be written into the database, but it cannot be loaded in the browser.
The controller that the verification code output method resides in inherits from the Backplatformcontroller controller,
The session class is called in the Backplatformcontroller constructor method.
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 ses S_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 (); Presence is updated $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 expired Session $sql = "Delete from it_session where expire < $last"; return $this->db->myquery ($sql); }}
Here is the verification code stored in session
It's done, OB cache is not cleared