Can't send value with Session
Posted: Sun Sep 05, 2010 6:11 pm
When I pass the value to another page with session_register the wrong value is printed. When I do the same thing by passing the value in the URL it works perfectly. So why can't I send it with Session??
I have another value, a $_COOKIE value. Maybe it's not possible to receive both a cookie and a session on the same page?
I use this code:
Do you see any errors?
I have another value, a $_COOKIE value. Maybe it's not possible to receive both a cookie and a session on the same page?
I use this code:
Code: Select all
//**** index.php ***
session_start(); // start up your PHP session!
$username = "Superman";
session_register("username");
//**** shop.php ***
$name = $_SESSION['username'];