PHP Session lost after redirecting
===

Really annoying problem I can't solve/can only partially solve. Nice juicy one for you pros.

I've got a basic login system set up. Like this:

Login.php:

1. line 1: `session_start();`
2. Check `if($_SESSION['logged_in'] == true) header("Location: /controls.php);`, incase they've already entered their details.
3. If they haven't entered them yet, user enters credentials, if valid: `$_SESSION['logged_in'] = true;`
4. After database credentials are checked and session is set to true, echo JavaScript redirect: `window.location.href = '/controls.php';`

Bear in mind, the session is now set.

Controls.php

1. line 1: `session_start();`
2. line 2: `if($_SESSION['logged_in'] != true) {header("Location: /index.php");}`

Instantly I get taken to index.php ONLY IN CHROME AND FIREFOX. Now here's the interesting part, because I can fix this partially by going back to `login.php` and changing the JavaScript to `window.location.reload(true);`. Remember, there's a PHP check at the start of this file testing for the session, so a reload will cause that check to become true.

However, in `Controls.php` there's a link to `accounttools.php`, where the session is again required. Once I click the link to `accounttools.php`, the session is destroyed, again ONLY IN FIREFOX AND CHROME.

WTF?!

Help me please :-) 

Thank you.