doushang1890 2014-04-02 13:17
浏览 38

Ajax请求不续订会话?

On my website, when user is logged in, there is an AJAX request going on every ~20seconds, the requested PHP is working with sesssion (starts with session_start).

I thought that having the website opened + the "infinite" ajax requesting should keep the logged-in user logged-in.

However I got an echo from one of my users, that he gets logged-out after a longer while - how is this possible? Isn't ajax request respectively the requested PHP renewing the Session?

What might cause these logg-outs?

Thanks in advance.

  • 写回答

2条回答 默认 最新

  • doutan1671 2014-04-02 13:21
    关注

    Try putting something like this in your header

    <?php
    ini_set('session.gc_maxlifetime', 60 * 60); //ini_set('session.gc_maxlifetime', Mulpitplyer*Seconds);
    session_start();
    ?>
    

    Sessions can also drop off if the user has an "unstable" internet conection

    评论

报告相同问题?

悬赏问题

  • ¥15 r包runway详细安装教程
  • ¥15 Html中读取Json文件中数据并制作表格
  • ¥15 谁有RH342练习环境
  • ¥15 STM32F407 DMA中断问题
  • ¥15 uniapp连接阿里云无法发布消息和订阅
  • ¥25 麦当劳点餐系统代码纠错
  • ¥15 轮班监督委员会问题。
  • ¥20 关于变压器的具体案例分析
  • ¥15 生成的QRCode圖片加上下載按鈕
  • ¥15 板材切割优化算法,数学建模,python,lingo