Hi there,
Okie here it is (will cut back some code since it will be long...)
in the login.php I have
<?php
// set capture user id and pwd to single variables
$s_userid = $POST['usrid'];
$s_userpwd = $POST['pwd'];
define, formulate and connect to MS SQL database
execute query to retrieve user id and pwd in the database
get # of row return by the query
if ($rowreturned >0)
{
session_start();
header ("Cache-control: private");
$_SESSION['sess_userid'] = $s_userid;
$_SESSION['sess_pwd'] = $s_userpwd;
$_SESSION['sess_id'] = session_id();
session_write_close();
// print '<p> <a href = [url]http://localhost/webservername/phpscripts/welcome.php[/url]> Click here to continue </a> <p>';
header ("location: [url]http://localhost/webservername/phpscripts/welcome.php[/url]");
exit();
}
else
{
print "redirect user back to home page".
}
?>
my welcome.php
<?php
session_start();
print "Welcome " . $_SESSION['sess_user'] . "<br />";
print "You have logged on with the pw of : " . $SESSION['sess_pwd'] . " and the current session is : " . $SESSION['sess_id'] . "<br />";
print '<p> <a href = "logout.php"> click here to log out </a> </p>';
?>
=================================
Tsinka,
Did I missed any thing??????
As I said the only way I can maintain the session id and information is throught the href method and not with the header.
Thanks for your help.