Short: For some reason, the cookie '_sid' isn't being retrieved by some browser/computers. Long: I have 3 files I'm using. /index.php, /scripts/login.php, and /iframes/register.php. Now when login info is entered, a bunch of standard stuff happen, and user is logged in. A cookie called '_sid' is set, and the value is stored in an mySQL table.
login.php:
setcookie("_sid", $sid, 0, '/'); ?>
Now all computers get this cookie - I've tested on over 15, all passed. Just wanted to show you how I set the cookie.
The problem lies in index.php:
<?php
$username="x"; $password="y"; $database="z";
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$loggedin=false; $team="none";
if(isset($_COOKIE['_sid'])){ //error happens here
print_r("test");
$session_id=$_COOKIE['_sid'];
Now the error occurs on the commented line. The isset returns false. Now normally this would be some sort of helpful indicator. However...
The third file, register.php, gives the user the ability register other people (irrelevant). The important thing to note is that the beginning of the file is the exact same as index.php.
<?php
$username="x"; $password="y"; $database="z";
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$loggedin=false; $team="none";
if(isset($_COOKIE['_sid'])){
print_r("test");
$session_id=$_COOKIE['_sid'];
This file, however, works. That's right, the isset works. This file also works on all 15/15 computers.
Now just to make this all the more confusing, index.php works on about 10 of the 15 computers. The error always occurs on mac (chrome, ff, safari) and Linux (ff tested, but fair to assume chrome too). It works on most windows (7+8 using chrome, ff). However, when using identical twin computers (on a ghosted os), one computer worked, and the other failed (using ff).
I've been at this problem for 2 days now, and really have no idea what to do...