Skip to content

Commit

Permalink
pass the session to JS if PHP has it
Browse files Browse the repository at this point in the history
  • Loading branch information
ptarjan committed May 14, 2010
1 parent 20821dc commit b1b9862
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions examples/example.php
Expand Up @@ -66,10 +66,11 @@
<script>
window.fbAsyncInit = function() {
FB.init({
appId : '<?php echo $facebook->getAppId(); ?>',
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml : true // parse XFBML
appId : '<?php echo $facebook->getAppId(); ?>',
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml : true // parse XFBML
session : <?php echo json_encode($session); ?>, // don't refetch the session when PHP already has it
});

// whenever the user logs in, we refresh the page
Expand Down

0 comments on commit b1b9862

Please sign in to comment.