开发者

Firefox not sessioning properly

I'm currently creating a shoutbox which requires users to be logged in to see. However FF5 (Mozilla Firefox 5) is not allowing members to see it whilst browsers such as IE9 and Chrome are fine with it.

My sessions are set by the login then db.php puts them into a variable:

e.g.

$_SESSION['ex1'] = "$username";
$_SESSION['ex2'] = "$password";

if (isset($_SES开发者_如何学JAVASION['ex1']) && isset($_SESSION['ex2'])) {
   $log = mysql_query("SELECT * FROM `members` WHERE `id` = '" . $_SESSION['ex1'] . "' AND password = '" . $_SESSION['ex2'] . "'")or die(mysql_error());
   $logged = mysql_fetch_array($log);
}

But when I check if the user is online on my shoutbox file:

if($logged){

}else{

}

On Firefox 5 it says you are logged out where as all other browsers detect that you are logged in. Does anyone know why this happens or what the issue may be?


It's a very odd issue when the browser affects the result of server side code. Make sure cookies are enables in ff as that might prevent the session id from being saved.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜