Skip to content

Instantly share code, notes, and snippets.

@peta
Created September 15, 2012 14:35
Show Gist options
  • Select an option

  • Save peta/3728242 to your computer and use it in GitHub Desktop.

Select an option

Save peta/3728242 to your computer and use it in GitHub Desktop.
Small fix that prevents session data from getting corrupted when the Facebook PHP SDK is used within Kohana
Index: src/application/vendor/facebook-sdk/src/facebook.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/application/vendor/facebook-sdk/src/facebook.php (revision )
+++ src/application/vendor/facebook-sdk/src/facebook.php (revision )
@@ -106,7 +106,7 @@
}
$session_var_name = $this->constructSessionVariableName($key);
- $_SESSION[$session_var_name] = $value;
+ Session::instance()->set($session_var_name, $value);
}
protected function getPersistentData($key, $default = false) {
@@ -116,8 +116,7 @@
}
$session_var_name = $this->constructSessionVariableName($key);
- return isset($_SESSION[$session_var_name]) ?
- $_SESSION[$session_var_name] : $default;
+ return Session::instance()->get($session_var_name, $default);
}
protected function clearPersistentData($key) {
@@ -127,7 +126,7 @@
}
$session_var_name = $this->constructSessionVariableName($key);
- unset($_SESSION[$session_var_name]);
+ Session::instance()->delete($session_var_name);
}
protected function clearAllPersistentData() {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment