LaundroMat
Programmer
I've got a little login script setup, but I'm stumped when it comes to session handling.
The first script collects the data in a form (main.php) and sends it to checklogin.php. This script compares the data entered with what's in the database. If all's ok, it copies the userID and nickname to session variables and then it includes a script called message.php. message.php creates a html page with a message plastered on (something like: "logged in fine!"). The HTML has a header redirecting the user to the main page after 5 seconds.
Now, tracking $_SESSION shows that up until the message.php script the session variables are not empty (ie they contain user id & nickname). After the redirection (a META tag in the HTML header of the message.php output), the session is empty.
The page message.php redirects to is the main page (main.php), and that page has a session_start() in it.
The first script collects the data in a form (main.php) and sends it to checklogin.php. This script compares the data entered with what's in the database. If all's ok, it copies the userID and nickname to session variables and then it includes a script called message.php. message.php creates a html page with a message plastered on (something like: "logged in fine!"). The HTML has a header redirecting the user to the main page after 5 seconds.
Now, tracking $_SESSION shows that up until the message.php script the session variables are not empty (ie they contain user id & nickname). After the redirection (a META tag in the HTML header of the message.php output), the session is empty.
The page message.php redirects to is the main page (main.php), and that page has a session_start() in it.