CliffLandin
Programmer
I am having a problem with session variables. I can't seem to consistently read them.
This how I declare the session variable:
session_start();
header("Cache-control: private");
$_SESSION['user'] = $user;
This is how I read the variable:
session_start();
header("Cache-control: private");
if (!isset($_SESSION['user']))
header("Location:else
$user=$_SESSION['user'];
Sometimes it works. Sometimes it doesn't. What am I doing wrong? It drives me crazy.
When in doubt, go flat out!
This how I declare the session variable:
session_start();
header("Cache-control: private");
$_SESSION['user'] = $user;
This is how I read the variable:
session_start();
header("Cache-control: private");
if (!isset($_SESSION['user']))
header("Location:else
$user=$_SESSION['user'];
Sometimes it works. Sometimes it doesn't. What am I doing wrong? It drives me crazy.
When in doubt, go flat out!