I have this written at the very first line on every page of my website.
include(\"restd.php\");
and restd.php contains the following lines
Do you actually set $_SESSION['id'] on a page...
What you are trying to do here is:
Do you actually do this in index.php?
session_start();
$_SESSION['id'] = something;
Check maybe your session path does not exist so you can save PHP session path using:
ini_set(' session.save_path','SOME WRITABLE PATH');
I know this is an old thread, but the following helped me with the same problem after hours of despair. Found on: http://php.net/manual/de/function.session-save-path.php
I made a folder next to the public html folder and placed these lines at the very first point in index.php
Location of session folder:
/domains/account/session
location of index.php
/domains/account/public_html/index.php
What I placed in index.php at line 0:
<?php
ini_set('session.save_path',realpath(dirname($_SERVER['DOCUMENT_ROOT']) . '/../session'));
session_start();
?>
Hopefully this will save you time.