Morning (or afternoon depending on where you are!)
I have a problem with a very basic session script.
I have two pages, page1 and page2, for debugging purposes currently each page starts with
On the login page I set the cookie using
when I login and move to page 2 it acts as if the session is not set and displays "no session"
I thought the cookie wasnt setting or being carried over so I changed the echo "no session" to
expecting it to come back blank, it didnt, the cookie displayed exactly what I expected it to (in this case "this is my test cookie").
Im now lost??????
I have a problem with a very basic session script.
I have two pages, page1 and page2, for debugging purposes currently each page starts with
Code:
session_start();
if(!isset($_SESSION['userid'])) {
echo "no session";
} else {
//do code for page....
On the login page I set the cookie using
Code:
Setcookie("userid","This is my test cookie");
when I login and move to page 2 it acts as if the session is not set and displays "no session"
I thought the cookie wasnt setting or being carried over so I changed the echo "no session" to
Code:
echo $_COOKIE["userid"];
Im now lost??????