3 require_once(dirname(dirname(__FILE__)) .
'/extlibinc/base_facebook.php');
38 parent::__construct($config);
39 if (!empty($config[
'sharedSession'])) {
45 array(
'state',
'code',
'access_token',
'user_id');
54 $this->sharedSessionID =
$data[
'id'];
61 $this->sharedSessionID = md5(uniqid(mt_rand(),
true));
64 'domain' => $base_domain,
65 'id' => $this->sharedSessionID,
68 $_COOKIE[$cookie_name] = $cookie_value;
69 if (!headers_sent()) {
71 setcookie($cookie_name, $cookie_value,
$expire,
'/',
'.'.$base_domain);
75 'Shared session ID cookie could not be set! You must ensure you '.
76 'create the Facebook instance before headers have been sent. This '.
77 'will cause authentication issues after the first request.' 90 if (!in_array(
$key, self::$kSupportedKeys)) {
96 $this->ssp_state[$session_var_name] = $value;
100 if (!in_array(
$key, self::$kSupportedKeys)) {
106 return isset($this->ssp_state[$session_var_name]) ?
107 $this->ssp_state[$session_var_name] : $default;
111 if (!in_array(
$key, self::$kSupportedKeys)) {
117 if (isset($this->ssp_state[$session_var_name])) {
118 unset($this->ssp_state[$session_var_name]);
123 foreach (self::$kSupportedKeys as
$key) {
126 if ($this->sharedSessionID) {
135 setcookie($cookie_name,
'', 1,
'/',
'.'.$base_domain);
139 return self::FBSS_COOKIE_NAME .
'_' . $this->
getAppId();
144 if ($this->sharedSessionID) {
145 array_unshift($parts, $this->sharedSessionID);
147 return implode(
'_', $parts);
151 if ($this->state === null) {
static getStateId(&$state, $rawId=false)
Retrieve the ID of a state array.
getBaseDomain()
Get the base domain used for the cookie.
establishCSRFTokenState()
__construct(array $config, &$ssp_state)
Identical to the parent constructor, except that we start a PHP session to store the user ID and acce...
Extends the BaseFacebook class with the intent of using PHP sessions to store user ids and access tok...
setPersistentData($key, $value)
Provides the implementations of the inherited abstract methods.
getSharedSessionCookieName()
constructSessionVariableName($key)
Create styles array
The data for the language used.
getPersistentData($key, $default=false)
parseSignedRequest($signed_request)
Parses a signed_request and validates the signature.
clearPersistentData($key)
getAppId()
Get the Application ID.
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
deleteSharedSessionCookie()
Provides access to the Facebook Platform.
makeSignedRequest($data)
Makes a signed_request blob using the given data.