Jump to content

session lost


stvchez

Recommended Posts

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.