Hi guys,
I am a bit of a cookie newbie, never had to use them so didn’t bother reading up on them.
so i did today.
I thought i was doing well.
I have a simple login system on the front-end of my site.
First test was to pass the user & pw to the script via url string and check against the db and if ok setcoookie
if (empty($_GET['md_user']) || empty($_GET['md_pass'])) {
echo "Error no cookie vars found";
exit;
} else {
setcookie("goUser", $_GET['md_user']);
setcookie("goPass", $_GET['md_pass']);
header("Location: workspace.php");
}
Workspace.php would then read the cookie and do x,y,z
This works fine.
So my next step was to create a flash login and that would essentially do the same.
include "common.php";
$link = dbConnect();
$user = $_POST['me_user'];
$pass = $_POST['me_pass'];
$userDetails = auth($user, $pass);
if ($userDetails == -1) {
fail("Invalid username and/or password");
}
setcookie("goUser", $user);
setcookie("goPass", $pass);
print "&retval=1&";
When flash recieve the returnVal then we launch a fullscreen popup
result_lv.onLoad = function(success) {
if (success) {
if (result_lv.retval == 1) {
getURL("javascript:NewWindow=window.open('workspace.php','newWin','width='+screen.availWidth+',height='+screen.availHeight+',left=0,top=0,toolbar=No,location=No,scrollbars=No,status=No,resizable=No,fullscreen=Yes'); NewWindow.focus(); void(0);");
} else {
txStatus.htmlText = "<font color='#990000'>" + unescape(result_lv.errormsg) + "</font>" + newline + unescape(login_lv);
}
}
};
Again this works to the point that the popup is launched but it dosn’t seem to be able to find the cookie i set in the login script.
Anyone want to point me on the right path.
Thanks
Paul