Session variable working in IE and Safari, but not Chrome, Opera or Firefox?
<p>I'm setting a session variable from a log in page ($_SESSION['login']). I've tested thoroughly, the variable is definitely being created and the correct value is being stored ($_SESSION['login'] = '1'), but the variable isn't recognized in the next page using Chrome, Opera or Firefox - oddly enough, the same script works as I expect in Safari and Internet  Explorer.</p>

<p>Any help at all would be greatly appreciated - I've been trying to figure this one out for a while and just can't get it - I'm at a complete loss here.</p>

<p>Here's the step by step -</p>

<pre><code>&lt;?php
// log in page
// if logged in successfully set the session variable

session_start();

if (// log in credentials good) {
    $_SESSION['login'] = '1';
    header('location:inside_page.php');

    // echo $_SESSION['login'] ;
    // ----------------------
    // commenting out the redirect and echoing
    // the session variable works as expected
    // in IE, Safari, Chrome, Opera and Firefox
}

?&gt;
</code></pre>

<p>Here's my Check_login class - it get's instantiated in the next page (inside_page.php) -</p>

<p>class:</p>

<pre><code>&lt;?php

if (! defined('EXT')){ exit('Invalid file request'); }

class Check_login { 
    private $login = null ;

    function __construct() {
        session_start();
        $this-&gt;login = $_SESSION['login'];
        if ($this-&gt;login != '1') {
            header('location:../index.php');
        }

        // $login = $this-&gt;login ;
        // echo $login ;
        // $session = $_SESSION['login'];
        // echo $session ;
        // ----------------------
        // commenting out the redirect and echoing the
        // session variable shows 1 in IE and Safari, but
        // empty in Chrome, Opera and Firefox
    }

}

?&gt;
</code></pre>

<p>page (inside_page.php):</p>

<pre><code>&lt;?php

require('../lib/Check_login.php');

session_start();

$login = new Check_login;

?&gt;
</code></pre>

<p>Again, any help at all would be really awesome. Thanks!</p>
