stvchez Posted February 27, 2007 Share Posted February 27, 2007 I'm not sure what is going on. yesterday, session management was working. today, I cannot get a session to pass from page to page no matter what I try. // page 1 $username = $_POST['username']; $_SESSION['sessUser'] = $username; //page 2 session_start(); $username = $_SESSION['sessUser']; echo"$username"; //nothing... is there any troubleshooting methods or anything that I could try? Quote Link to comment Share on other sites More sharing options...
bhavin_85 Posted February 27, 2007 Share Posted February 27, 2007 echo print_r($_SESSION); use that to check if there are any sessions set Quote Link to comment Share on other sites More sharing options...
stvchez Posted February 27, 2007 Author Share Posted February 27, 2007 I get this in return. Array ( ) 1 Quote Link to comment Share on other sites More sharing options...
bhavin_85 Posted February 27, 2007 Share Posted February 27, 2007 ok so that tells you that the session variable is not setting anything, can you past the full code for page 1 and 2...the php parts that is Quote Link to comment Share on other sites More sharing options...
stvchez Posted February 27, 2007 Author Share Posted February 27, 2007 here is the php code from each page. thanks. // page1 session_start(); $username = $_POST['username']; echo"$username"; // value: test123 $password = $_POST['password']; $_SESSION['sessUser'] = $username; $_SESSION['loggedin'] = "true"; session_register("username"); session_register("password"); header("Location: /virtual-coach/calendarHome.php"); } page 2 session_start(); $username = $_SESSION['sessUser']; $loggedin = $_SESSION['loggedin']; echo print_r($_SESSION); echo "$username"; Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.