I'm creating a script with sessions but the server doesn't remember the settings. It's using a variable id so that might be the problem but how can I fix this?
Here is the code:
URL Example: http://domain.eu/isloggedin.php?code={0} <- Windows Application will fill this in.
Login:
<?php
ini_set("display_errors", 1);
error_reporting(E_ALL);
session_start();
$code = $_GET['code'];
$lstring = $code . "-CONFIG";
$_SESSION[$lstring] = "True";
?>
GET:
<?php
ini_set("display_errors", 1);
error_reporting(E_ALL);
session_start();
$code = $_GET['code'];
$lstring = $code . "-CONFIG";
if (isset($_SESSION[$lstring])){
echo "True";
}
What am I doing wrong??
Regards,
Daniël