dongwenhui8900 2010-01-12 07:04 采纳率: 0%
浏览 25
已采纳

元刷新标签会“破坏”PHP会话吗?

I am using session variables to store user display settings while their session is active.

For example, if I choose to display 5 items on the page with session variables then there is no problem. I can manually (f5) refresh the page and still see 5 items on the page. However, upon implementing the following meta tag to auto-refresh, every time the page refreshes it switches to the default value of 3.

<meta http-equiv="refresh" content="300">

I expect maybe this meta refresh is causing a new session to be created and therefore the user setting is simply out of the picture.

Does anyone have experience with this type of issue - is this the case and is there a known way to implement a page refresh and still maintain session?

  • 写回答

2条回答 默认 最新

  • dsjbest2015 2010-01-12 07:07
    关注

    From my own experience, nope, it doesn't and it shouldn't. Unless of course you refresh it after the session timeout.

    Is javascript setTimeout and replace an alternative yuou are considering?

    <script type="text/javascript">
      window.setTimeout('location.replace(location.href)', 300 * 1000);
    </script>
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥60 pb数据库修改或者求完整pb库存系统,需为pb自带数据库
  • ¥15 spss统计中二分类变量和有序变量的相关性分析可以用kendall相关分析吗?
  • ¥15 拟通过pc下指令到安卓系统,如果追求响应速度,尽可能无延迟,是不是用安卓模拟器会优于实体的安卓手机?如果是,可以快多少毫秒?
  • ¥20 神经网络Sequential name=sequential, built=False
  • ¥16 Qphython 用xlrd读取excel报错
  • ¥15 单片机学习顺序问题!!
  • ¥15 ikuai客户端多拨vpn,重启总是有个别重拨不上
  • ¥20 关于#anlogic#sdram#的问题,如何解决?(关键词-performance)
  • ¥15 相敏解调 matlab
  • ¥15 求lingo代码和思路