Alright, I've read just about everything I can find on this, but I am still having trouble understanding how to make a basic cookie work.
Here is what I am doing:
I have a login page, after submitting, it POST's the info to a 'validation' page. Assuming the username/password match up, it then sets a cookie.
What I am using is:
setcookie("USERNAME",$username);
After it does this, the page is then redirected to the "main" page of the members only portion.
Very first thing in this file, I have "include" a validateuser.php script.
This script checks for the cookie. If it is not present, the user is redirected back to the login page, else it proceeds.
How, exactly, should I set this cookie. And how, exactly, do I check to see that it HAS been set (so someone can't just type in the URL to the members only page. they HAVE to log in and get the cookie set.)
Thanks,
Adam