close

CI  在 PHP7 中 SESSION 可以寫入,但卻一直讀不到?

 

根本原因在这,libraries/Session/Session.php 中 128行

  1. if (isset($_COOKIE[$this->_config['cookie_name']])
  2.  
    && (
  3.  
    ! is_string($_COOKIE[$this->_config['cookie_name']])
  4.  
    OR ! preg_match('/^[0-9a-z]{10,40}$/', $_COOKIE[$this->_config['cookie_name']])
  5.  
    )
  6.  
    )
  7.  
    {
  8.  
    unset($_COOKIE[$this->_config['cookie_name']]);
  9.  
    }
     
     
    /^[0-9a-f]{40}$/,要改成 /^[0-9a-z]{10,40}$/   
     
    這樣就可以解決這個問題了。   
     
     
    媽阿,為了這個卡了好久!!! 在改5年前寫的東西。有點淡淡的哀傷
     
     

arrow
arrow
    文章標籤
    PHP codeigniter
    全站熱搜

    peeress 發表在 痞客邦 留言(0) 人氣()