我遇到了有关缓存、cookies 和 Codeigniter 的问题。
当我使用用户名和密码登录时,出现这样的提示。
然后我点击保存密码
。之后,我有一张表单,其中还有用户名和密码字段。这些字段会自动填充我在之前的应用程序登录中输入的用户名和密码。
如何删除用户名和密码?我正在使用 Codeigniter。
最佳答案
我找到了this这提出了一个理论。我引用:
If the browser detects <input type="password">, it will assume that the <input type="text"> IMMEDIATELY in front of it is the username input.
经过一些 self 测试,我发现这是真的。
在寻找解决方案时,我发现 this one .
具体:
Simply create a couple of fields and make them hidden with "display:none". Example:
<!-- fake fields are a workaround for chrome autofill getting the wrong fields -->
<input style="display:none" type="text" name="fakeusernameremembered"/>
<input style="display:none" type="password" name="fakepasswordremembered"/>
这是一个笨拙的解决方案。但它确实有效。
关于javascript - 如何在 Codeigniter 中禁用 cookie 和缓存,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32986474/