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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.