PHP: $_SESSION doesn't set

Before setting as duplicate, I've spent 4 hours on researching about my problem, but I had no luck.

I am trying to make a signup/login system for my website. The main point that doesn't seem to work is that when I am signing up on my website, the session doesn't seem to start. The reason that I can see it is because, on my navbar, I have set it to change from signup to log out. Here is the piece of code for that:

and the last one is the file which connects PHP to the database code below:

$conn = mysqli_connect("XXX","XXX","XXX","XXX");

if (!$conn){
die("Connection failed: ".mysqli_connect_error());
}

I believe that the session doesn't start because the main page reloads after the user hits signup on the form, but I have started the session on all of my files (except the database connection file where it's not needed). I used session start on all of my page and I placed it on the beginning of all pages with opening and closing PHP tags.

Insert queries do NOT return a result set, and you can NOT fetch() from them. That means mysqli_fetch_assoc() is failing, and returning a boolean FALSE. You then use that boolean false as if it was an array, and are basically doing the equivalent of