Answer the question
In order to leave comments, you need to log in
Xampp - how to make sessions work?
There is such a code
if (!isset($_SESSION)) {
//session_name("u1");
session_start();
$_SESSION ['login'] = '$login';
$_SESSION ['pass'] = '$pass';
$_SESSION ['auth'] = true;
$_SESSION ['id'] = '$p_id';
$_SESSION ['role'] = 'USER';
echo 'Session registrate!' ;
} else {
print_r ( $_SESSION ) ;
unset ( $_SESSION ) ;
}
session register!
Answer the question
In order to leave comments, you need to log in
isset($_SESSION) does not make sense to check before we called the session_start() command;
take out session_start(); behind the if-else block and check if login , pass , auth are set.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question