dounangshen6553 2015-10-07 07:43
浏览 82
已采纳

如何在Codeigniter中禁用cookie和缓存

I am facing a problem regarding the cache and cookies and Codeigniter.

When I log in using a username and a password, there is a prompt like this.

Save Password

I then click Save Password. After that I have one form where there are also username and password fields. These fields become automatically filled with the username and password that I have entered from the previous application login.

One Form

How do I get rid of the username and password? I am using Codeigniter.

  • 写回答

1条回答 默认 最新

  • douxiongye5779 2015-10-07 08:46
    关注

    I found this that presents a theory. I quote:

    If the browser detects <input type="password">, it will assume that the <input type="text"> IMMEDIATELY in front of it is the username input.

    With some testing myself, I found this to be true.

    theory test

    In searching for solutions I found this one.

    Specifically:

    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"/>
    

    This is a kludgy solution. However it works.

    kludgy soln

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 三菱伺服电机按启动按钮有使能但不动作
  • ¥20 为什么我写出来的绘图程序是这样的,有没有lao哥改一下
  • ¥15 js,页面2返回页面1时定位进入的设备
  • ¥200 关于#c++#的问题,请各位专家解答!网站的邀请码
  • ¥50 导入文件到网吧的电脑并且在重启之后不会被恢复
  • ¥15 (希望可以解决问题)ma和mb文件无法正常打开,打开后是空白,但是有正常内存占用,但可以在打开Maya应用程序后打开场景ma和mb格式。
  • ¥20 ML307A在使用AT命令连接EMQX平台的MQTT时被拒绝
  • ¥20 腾讯企业邮箱邮件可以恢复么
  • ¥15 有人知道怎么将自己的迁移策略布到edgecloudsim上使用吗?
  • ¥15 错误 LNK2001 无法解析的外部符号