I'm having a problem with my session variables.
I can't set any variable after my require once. But I need to store my data after the login.
Here is the code :
<?php include "include/header.php";
require_once('simplesamlphp/lib/_autoload.php');
$as = new \SimpleSAML\Auth\Simple('default-sp');
$as->requireAuth();
$attributes = $as->getAttributes();
$_SESSION["nivauth"] = "test";
?>
EDIT :
- session_start() is in the header.php
- i try to get the session var on another page with
echo $_SESSION["nivauth"];
I have this error on the other page :
Notice: Undefined index: nivauth in /var/www/html/cableEdit.php on line 10
And my session var nivauth is available only on my first page.
My session_start() is working, and all my others sessions variables are created on others pages can be viewed.
If I place $_SESSION["nivauth"] = "test";
just under the include everything works, but I can't get nivauth from the authentification.
The var is created but can't be accessed on other page...