LOADING
Loading
Hi , welcome back.
LogoutLOGOUT
 
  Lost password?  
Hi
 


Prev Previous Post   Next Post Next
  #1  
Old 04-12-2007, 01:23 PM
[PAUL FERRIE]'s Avatar
[PAUL FERRIE] [PAUL FERRIE] is offline
Glasgow Flash Developer
 
Join Date: Feb 2005
Location: United Kingdom
Posts: 7,756
Rep Power: 16
[PAUL FERRIE] is on a distinguished road
Cookie newbie need help

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. :confused:

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 Code:

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 Code:

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
Actionscript:
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
__________________
.:To me AS is like LEGO, Only for the big Kids :.
- Site - Blog - Glasgow Flasher - Activeden

- bringmadeleinehome.com
Reply With Quote
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Flash Builder for Newbie xyz777 New Softwares 1 03-16-2010 09:47 PM
Get Cookie and Set Cookie rbgerman Flash MX 2 03-15-2006 03:30 PM
Reading/writing a cookie in Flash Schteve Flash MX 1 08-12-2005 10:09 AM
Newbie question about scale PaLoBo Newbies 2 05-21-2005 08:56 AM




All times are GMT. The time now is 11:16 AM.