Having trouble cause Flash php user function called

Hi all

I have a php index file that performs basic authentication:

$ Facebook = new Facebook (array (
Observing ' = "myAppID > '
Confidential = > ' myAppSecret ',
Cookies = > ' true ',
));

//Get user ID
$ User = $ Facebook-> getUser ();

{If ($ user)
Try {
//Continue knowing you have connected to the authenticated user.
$ User_profile = $ Facebook-> api (/me);
} Catch {(FacebookApiException $ e)
Error_log ($ e);
$ User = null;
}
}

If ($ user) {
Embeds the swf file
}
Another
{
Send url logout;
}

Once the swf is running at the end of the application I call a php file called endofapp php where I want.
Send my SQL DB statistics.
However PHP file first attempts to the user with the following code is the same as whcih one above:

//Create an instance of our application (replace it with a check at a secret).
$ Facebook = new Facebook (array (
Observing ' = "myAppID > '
Confidential = > ' myAppSecret ',
Cookies = > ' true ',
));

//Get user ID
$ User = $ Facebook-> getUser ();

{If ($ user)
Try {
//Continue knowing you have connected to the authenticated user.
$ User_profile = $ Facebook-> api (/me);
} Catch {(FacebookApiException $ e)
Error_log ($ e);
$ User = null;
}
}

If ($ user) {
$ ID = $ user_profile [' ID '];
$ Aaa = $ _POST ["aaa"];
$ BB bThis = $ _POST [' BB bThis '];
//Input uses is function to send the data to my SQL DB
InputUser ($ ID, $ aaa, $ BB bThis);

}
{Else
Echo "FAILLLLLLL";
}

However, if ($ user) will not happen and read user input never receives and im not understanding why????
Working index file because if not you will not be in this part, and im doing this from within Facebook, so I logged, verified.

Its driving me crazy ...

Using 3.1.0 sdk and now I tried with 3.1.1 still not working ...