# Cookie newbie need help

**URL:** <https://forum.kirupa.com/t/cookie-newbie-need-help/222304>\
**Category:** programming\
**Created:** [April 12, 2007, 11:39am UTC](https://forum.kirupa.com/t/cookie-newbie-need-help/222304 "2007-04-12T11:39:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![paul\_ferrie](https://avatars.discourse-cdn.com/v4/letter/p/919ad9/32.png) [@paul\_ferrie](https://forum.kirupa.com/u/paul_ferrie)\
**Post date:** [April 12, 2007, 11:39am UTC](https://forum.kirupa.com/t/cookie-newbie-need-help/222304/1 "2007-04-12T11:39:51Z")

</div>

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

```php

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.

```php

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

```auto

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
