I checked all the other possible duplicates before posting but none of them solved my problem
Everything was working perfectly fine when using localhost, now i'm trying to upload it on a host server, but there seem to be a problem when i try to start a session..
This is the part of code concerned:
header('refresh:5;URL= ./info.php');
print "<br/>Signed in Successfully<br /> You will be redirected shortly";
session_start();
$_SESSION["login_user"]=$_POST["inputUsername"];
var_dump($_SESSION);
And this is the corresponding output:
As you can see from the code, After the session was started, The word "Started" should be printed, which is not the case, However the print statement just before the session_start was executed.
Any idea what could be the problem? Thank you
You should always start your session first thing. Starting your session needs to send a header, which does not work if you've allready send one (for instance, explicitly, but also implicitly by e.g. doing output.
Always do your session_start()
first.