dragonmeng2002 2010-10-06 03:12
浏览 57
已采纳

会话cookie是否在浏览器关闭时到期?

I have a PHP application where I set $_SESSION['user']="logged" once a user is authenticated. I call this loginpage.php.

Once authenticated and the session variable set, the user is taken to a member page which starts with the lines:

<?php
session_set_cookie_params(0,'/');
session_start();
if($_SESSION['user'] != 'logged') {
header ("Location:loginpage.php");
}?>

When a user has logged in, closes the browser and then visits the members page, I expect him to be redirected to loginpage.php.

However, this does not happen. The session cookie is still there in the browser - I tested this using Firefox.

Could someone explain to me where I'm getting it wrong?

  • 写回答

4条回答 默认 最新

  • dook0034 2010-10-06 03:37
    关注

    The cookie should be deleted, because you set his lifetime to 0.

    Maybe there is still a firefox-process running, take a look into the taskmanager.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?

悬赏问题

  • ¥15 HFSS 中的 H 场图与 MATLAB 中绘制的 B1 场 部分对应不上
  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?