How does user log into Facebook app after authorizing it
<p>I appreciate all those who help by giving usable answers, so the question is quite simple, but I just can't figure it out, I have understood the part that talks about getting user authorization via the Oauth dialog when creating an app that's going to be in the Facebook chrome within a canvas. Basically you just access the signed request parameter and prompt the user to authorize the app with whatever requirements it may need, you know, like user info involving friends list, user id, name, ability to post photos on wall etc. it's like this:</p>

<pre><code>&lt;?php 

 $app_id = "YOUR_APP_ID";

 $canvas_page = "YOUR_CANVAS_PAGE_URL";

 $auth_url = "http://www.facebook.com/dialog/oauth?client_id=" 
        . $app_id . "&amp;redirect_uri=" . urlencode($canvas_page);

 $signed_request = $_REQUEST["signed_request"];

 list($encoded_sig, $payload) = explode('.', $signed_request, 2); 

 $data = json_decode(base64_decode(strtr($payload, '-_', '+/')), true);

 if (empty($data["user_id"])) {
        echo("&lt;script&gt; top.location.href='" . $auth_url . "'&lt;/script&gt;");
 } else {
        echo ("Welcome User: " . $data["user_id"]);
 } 
 ?&gt;
</code></pre>

<p>if i'd need anymore data, i'd specify it using the scope parameter at the end of my canvas page url, you know, access to friends list, ability to post and so on. so i think this part would go into my index.php file, and when i do get the user info, i'd store it in respective tables inside a database. i'd then start a session using all the data and need for the app to work, and when the user logs out, i'd destroy the session. one thing i don't get is, what happens when the user logs in to Facebook again? he/she would have already authorized my app and i guess it would be in their app list, i don't get how, when they click on the url in the list, i'd again get their data and log them into my up. the authorization is like signing up, what about the logging in? i'd need this to start a session, load their saved data from my database etc. i know it's a very rudimentary question, but i'm new to this Facebook app thing, and not a pro programmer. i have read the documentation, but still don't get the logging in after the user authorizes the app, how would that work? thanks in advance for the help, an example would be nice.</p>
