简体   繁体   中英

Internet Explorer issue holding a $_SESSION

I know there is heaps of this on the internet and i have tried things like use cookies (didnt work) check for blank anchors like and i have none of them. Microsoft is terrible i think we can all agree!

On safari, chrome and firefox etc (the good browsers) the code works fine and logs the user in. I am assuming the problem is resting with the session or cookie data because if you type in a wrong username/password on the website it comes up with an error saying its invalid (on internet ex).

The code where i am setting the session and cookies is this:

       session_start();

    $_SESSION['user_id']= $id;  
    $_SESSION['user_name'] = $full_name;
    $_SESSION['user_level'] = $user_level;
    $_SESSION['HTTP_USER_AGENT'] = md5($_SERVER['HTTP_USER_AGENT']);

So this should work fine should it not? Thank you for taking time to read this.

Quick edit: I also have a facebook login button and this section of code is if the account is linked (it still involves $_SESSION):

          while ($row = mysql_fetch_array($SrcUser)) 
            { 
                 $id = $row["id"];
                 $user_level = $row["user_level"];
            }

    session_start();
    $_SESSION['user_name'] = $full_name;
    $_SESSION['user_level'] = $user_level;
    $_SESSION['user_id']= $id;  
    mysql_query("update `users` 
        set `ckey`= '', `ctime`= '', `online`='0' 
        where `id`='$_SESSION[user_id]'") or die(mysql_error());


        // Javascript redirect.. its kinda cheating to be honest as if i dont use it i will have awkwardness with header errors
        ?>
  <script type="text/javascript">
        window.location = "myaccount.php"
        </script>

Trying adding the following to the header of the response

header( 'P3P: CP="NOI ADM DEV PSAi COM NAV OUR OTR STP IND DEM"' );

if that doesn't work try this

header ( 'P3P: CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"' );

more info

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM