某些瀏覽器緩衝驗證碼,導致重新開啟該頁面時總提示驗證碼到期。

來源:互聯網
上載者:User
重新整理瀏覽器就正常。
怎麼解決,有什麼代碼可以強行讓驗證碼重新載入的。


回複討論(解決方案)

產生地址後面加個js隨機參數,url?r=Math.random()


">

你在驗證碼圖片產生程式中加入禁止緩衝的頭

header ("Expires: Mon, 26 Jul 1997 05:00:00 GMT");    // Date in the pastheader ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");header ("Cache-Control: no-cache, must-revalidate");  // HTTP/1.1header ("Pragma: no-cache");                          // HTTP/1.0
就可一勞永逸的解決這個問題,而不必每到使用時去改變url

Math.random()

已經有了,可是不行,現在代碼是:




都加上了,也不行

你在驗證碼圖片產生程式中加入禁止緩衝的頭

header ("Expires: Mon, 26 Jul 1997 05:00:00 GMT");    // Date in the pastheader ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");header ("Cache-Control: no-cache, must-revalidate");  // HTTP/1.1header ("Pragma: no-cache");                          // HTTP/1.0
就可一勞永逸的解決這個問題,而不必每到使用時去改變url



加這個也不行
  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.