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? Link to comment https://forums.phpfreaks.com/topic/40349-session-lost/ 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 Link to comment https://forums.phpfreaks.com/topic/40349-session-lost/#findComment-195233 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 Link to comment https://forums.phpfreaks.com/topic/40349-session-lost/#findComment-195237 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 Link to comment https://forums.phpfreaks.com/topic/40349-session-lost/#findComment-195239 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"; Link to comment https://forums.phpfreaks.com/topic/40349-session-lost/#findComment-195242 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.