Please i have problem with php as when i want to login the session expire instantly , the Model :
public function Logger($login, $passe) {
$login = addslashes($login);
$passe = md5($passe);
try {
$conn = connexion::getConnexion();
$conn->beginTransaction();
$result = connexion::getConnexion()->query("SELECT id_user , type , login , nom , prenom , profil , enseignant, activer FROM p_user WHERE login = '$login' AND passe = '$passe' LIMIT 1");
$data = $result->fetch(PDO::FETCH_ASSOC);
$result->closeCursor();
return $data;
} catch (Exception $exc) {
$conn->rollBack();
return "Error :" . $exc->getMessage();
}
}
the controller :
if (isset($_POST)){
$obj = new p_user();
$result_connexion =$obj->Connecter($_POST['login'], $_POST['passe']);
if (empty($result_connexion)):
die('Login Ou bien Mot de passe Non Correct');
else:
$_SESSION = $result_connexion;
// var_dump($result_connexion);
$p_profil = new p_profil();
$get_liens=$p_profil->selectByTwoColumn('login', $result_connexion['login'], 'code_lien', 'LINK-0000068');
if(!empty($get_liens))
{
die("Happy End");
}
die("Good");
endif;
I'm trying to logging in but the page should redirect me to Dashboard but it's not it refresh to login page and i put code to print session login but it's null or empty
How to fix that and Thank you !!