3

My signed request looks like this when viewing a non-authorized page.

Array ( 
  [algorithm] => HMAC-SHA256 
  [issued_at] => 1328803958 
  [page] => Array ( 
    [id] => 114951721840 
    [liked] => 1 
    [admin] => 1 ) 
    [user] => Array ( 
      [country] => us 
      [locale] => en_US 
      [age] => Array ( [min] => 21 ) 
    ) 
)

After authorizing the app, the initial tab page signed request looks like this.

Array ( 
  [algorithm] => HMAC-SHA256 
  [expires] => 1328810400 
  [issued_at] => 1328804617 
  [oauth_token] => AAAEQiWKOJTUBAB7la6TzNybfDkv6eYwtGUayappUspm3hWx6qKAFw3Ahbdhqv1xZC27WmrZC0yMMdtE0pdxoiUruZABg1zN1DalnYqS5AZDZD 
  [page] => Array ( 
    [id] => 114951721840 
    [liked] => 1 
    [admin] => 1 ) 
    [user] => Array ( 
      [country] => us 
      [locale] => en_US 
      [age] => Array ( [min] => 21 ) 
    ) 
  )
  [user_id] => 30811359 
)

And finally, once I navigate away from this page, the signed request looks like this.

Array ( 
  [algorithm] => HMAC-SHA256 
  [code] => 2.AQAq5nTl5j7tMkqF.3600.1328810400.5-30811359|tXdv-ci5z1GIzo9CY5HXp_piL3I 
  [issued_at] => 1328804621 
  [user_id] => 30811359 
)

I can determine user likes with a valid user, but I want to figure out why I lose the standard signed request data after navigating from the initial tab page.

UPDATE : If I store the signed request into a session variable and load it on subsequent pages, I maintain the full signed request. Is there a reason I should not do this?

Jeremy Jones
  • 33
  • 1
  • 4

2 Answers2

7

UPDATE : If I store the signed request into a session variable and load it on subsequent pages, I maintain the full signed request. Is there a reason I should not do this?

That's exactly what you should do.

The signed request is only sent when a Facebook Tab is initially loaded by Facebook. Subsequent navigation within the Facebook Tab doesn't come with a signed request, as Facebook isn't initating the page load any more.

ceejayoz
  • 176,543
  • 40
  • 303
  • 368
1

I am facing the similar problem as "Jeremy Jones" mentioned. in some other post i found that the signed_request should be in the $_REQUEST['signed_request'] return. but it is empty for me and i get some value for $signed_request = $facebook->getSignedRequest(); but here the page array is missing.

nasirkhan
  • 9,948
  • 5
  • 27
  • 33
  • 1
    When signed request is empty in the page tab url settings of your app you must point it to index.php (source http://stackoverflow.com/a/5264840) – chepe263 Nov 28 '13 at 04:18