Cheetah
FacebookSessionPersistentDataHandler.php
Go to the documentation of this file.
1 <?php
24 namespace Facebook\PersistentData;
25 
27 
34 {
38  protected $sessionPrefix = 'FBRLH_';
39 
47  public function __construct($enableSessionCheck = true)
48  {
49  if ($enableSessionCheck && session_status() !== PHP_SESSION_ACTIVE) {
50  throw new FacebookSDKException(
51  'Sessions are not active. Please make sure session_start() is at the top of your script.',
52  720
53  );
54  }
55  }
56 
60  public function get($key)
61  {
62  if (isset($_SESSION[$this->sessionPrefix . $key])) {
63  return $_SESSION[$this->sessionPrefix . $key];
64  }
65 
66  return null;
67  }
68 
72  public function set($key, $value)
73  {
74  $_SESSION[$this->sessionPrefix . $key] = $value;
75  }
76 }
Facebook\PersistentData\FacebookSessionPersistentDataHandler\$sessionPrefix
$sessionPrefix
Definition: FacebookSessionPersistentDataHandler.php:38
Facebook\PersistentData\FacebookSessionPersistentDataHandler\__construct
__construct($enableSessionCheck=true)
Definition: FacebookSessionPersistentDataHandler.php:47
Facebook\Exceptions\FacebookSDKException
Definition: FacebookSDKException.php:32
use
GNU LESSER GENERAL PUBLIC LICENSE February Free Software Inc Franklin Fifth MA USA Everyone is permitted to copy and distribute verbatim copies of this license but changing it is not allowed[This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it By the GNU General Public Licenses are intended to guarantee your freedom to share and change free software to make sure the software is free for all its users This the Lesser General Public applies to some specially designated software packages typically libraries of the Free Software Foundation and other authors who decide to use it You can use it but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular based on the explanations below When we speak of free we are referring to freedom of use
Definition: license.txt:27
Facebook\PersistentData\FacebookSessionPersistentDataHandler
Definition: FacebookSessionPersistentDataHandler.php:34
php
Facebook\PersistentData\PersistentDataInterface
Definition: PersistentDataInterface.php:32
Facebook\PersistentData
Definition: FacebookMemoryPersistentDataHandler.php:24