I can echo the sessionid and get the same session id, but it seems i am loosing $_SESSION['name'] which i think is why it is doing this. Any ideas to why i am loosing it?
Thank you
Anthony
Code: Select all
<?php$lastlogon = date("l, M, d");
$pass = md5($pass);
$sql = "SELECT * FROM users where user='$uname' and pass='$pass'";
$result = mysql_query($sql);
$row = mysql_fetch_array($result);
if ($row["user"] == $uname && $row["pass"] == $pass) {
$lastlogon = date("l, M, d");
session_start();
$_SESSION['name'] = $uname;
if(isset($_SESSION['name'])) {
$sqll = "UPDATE users SET last_logon='$lastlogon' WHERE user='".$_POST['uname']."'";
if(mysql_query($sqll)) {
header("location: mypage");
}
else {
echo "Couldn't update user<br />".$sqll."<br />".mysql_error()."";
}
}
else {
echo "Couldn't Set User Session";
}
}
else {
$output = "<center><font face=arial size=-1 color=red>Username/Password do not match <a
href=loginbox.php>Click here to login again</a></font></center>";
include('html.inc');
start_header($output);
}
?>Code: Select all
<?php
session_start();
header("Cache-control: private");
$name = $_SESSION['name'];
if($_SESSION['name'] == "") { header("Location: http://www..com/test.php"); exit; }
?>