[PHP SDK] redirect after gives the user permissions

Hi all. I have a small problem. When I want my application asking the user to grant permissions to the application ??????? following code:

Works OK, but after the press uses "grant permission" is redirected to the URL of the application. I mean http://mydomain.com/myapp/ as directly, not the page to my application on Facebook.
You can work around it-I know my Facebook application, so you can address to redirect it to the appropriate http://apps.facebook.com/myappname. it works OK too. But-when someone adds my application some page-tab is where the problem occurs. Because I don't know where to redirect user more-I don't know, out of which page my application was called.

Is there a way to know, from which my application was called, or even better make Facebook correctly redirect the user after the "grant permission" dialog?

Last edited by grimskin (2011-05-09 20: 41: 12)