duanhuilao0787 2011-08-26 18:51 采纳率: 100%
浏览 48
已采纳

已知IE 8 PHP Session问题?

I have a login system that is being authenticated via a php session. My client is saying that login is failing now that I have moved the site to a new server. But only when he uses IE 8. I have been unable to replicate these issues.

What makes it even more odd is that it all works on the previous host. I am at a loss to whether it is a browser issue, the server change or anything else.

Are there any know issues? I thought it may be a header("location: ") issue, but it seemingly is working on the previous host.

Any help appreciated

The login code is this (It keeps returning my client to index.php?invalid even though he says he is entering the correct login details and I am able to access with no problem.

<?php
require('includes/functions.php');
require('includes/db.php');

$user=clean($_POST[user]);
$pass=clean($_POST[pass]);

$qry="SELECT id FROM table WHERE userfield='$user' 
AND passwordfield='".md5($pass)."'";

$result=mysql_query($qry);

if(mysql_num_rows($result)>0) {
    //Login Successful
    //Regenerate session ID to
    //prevent session fixation attacks
    session_start();
    session_regenerate_id();
    $result=mysql_fetch_assoc($result);
    $_SESSION['USER']=$result['id'];
    //Write session to disc
    session_write_close();
    header("location: success.php");
    exit();
}
    header("location: index.php?invalid");
?>
  • 写回答

1条回答 默认 最新

  • drj26159 2011-08-26 23:08
    关注

    Yes, IE8 has this problem with session cookies, especially when redirects are used. Try putting session_set_cookie_params(0); prior to starting the session - this would ensure that the session cookie will not expire until the browser is closed.

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

报告相同问题?

悬赏问题

  • ¥30 vmware exsi重置后登不上
  • ¥15 易盾点选的cb参数怎么解啊
  • ¥15 MATLAB运行显示错误,如何解决?
  • ¥15 c++头文件不能识别CDialog
  • ¥15 Excel发现不可读取的内容
  • ¥15 关于#stm32#的问题:CANOpen的PDO同步传输问题
  • ¥20 yolov5自定义Prune报错,如何解决?
  • ¥15 电磁场的matlab仿真
  • ¥15 mars2d在vue3中的引入问题
  • ¥50 h5唤醒支付宝并跳转至向小荷包转账界面