dtrnish3637 2015-01-15 03:54
浏览 37

浏览器后退按钮表单字段为空

I have session_start in all my code and this is working. When I click the browser back button and when i include this in my header.php file:

header_remove("Expires");
header_remove("Cache-Control");
header_remove("Pragma");
header_remove("Last-Modified")

the session variable $_SESSION['IAMAVARIABLE'] DOES NOT print/echo on the screen. But my form fields value appears. when i comment this out:

/*
header_remove("Expires");
header_remove("Cache-Control");
header_remove("Pragma");
header_remove("Last-Modified")
*/

the session variable $_SESSION['IAMAVARIABLE'] print/echo and my form fields value disappear.

I want both of them at to show at all times when i click the browser back button. any ideas what i am doing wrong. many thanks for your responses.

  • 写回答

1条回答 默认 最新

  • duanmei1930 2015-01-15 04:47
    关注

    From Php.net

    header_remove

    Caution

    This function will remove all headers set by PHP, including cookies, session and the X-Powered-By headers.

    Missing a semicolon

    header_remove("Last-Modified")
                                  ^
    

    It must be

    header_remove("Last-Modified");
    
    评论

报告相同问题?

悬赏问题

  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 关于大棚监测的pcb板设计
  • ¥15 stm32开发clion时遇到的编译问题
  • ¥15 lna设计 源简并电感型共源放大器
  • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)
  • ¥15 Vue3地图和异步函数使用