Skip to content

Commit b1b9862

Browse files
committed
pass the session to JS if PHP has it
1 parent 20821dc commit b1b9862

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

examples/example.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,11 @@
6666
<script>
6767
window.fbAsyncInit = function() {
6868
FB.init({
69-
appId : '<?php echo $facebook->getAppId(); ?>',
70-
status : true, // check login status
71-
cookie : true, // enable cookies to allow the server to access the session
72-
xfbml : true // parse XFBML
69+
appId : '<?php echo $facebook->getAppId(); ?>',
70+
status : true, // check login status
71+
cookie : true, // enable cookies to allow the server to access the session
72+
xfbml : true // parse XFBML
73+
session : <?php echo json_encode($session); ?>, // don't refetch the session when PHP already has it
7374
});
7475

7576
// whenever the user logs in, we refresh the page

0 commit comments

Comments
 (0)