Example #1
0
 /**
  * SessionData class' constructor
  *
  * @param string $a_id
  *        Session Identifier
  */
 public function __construct($a_id = null)
 {
     if ($a_id != null) {
         $this->session_id = $a_id;
     } else {
         if (Cookie::get('apine_session') != null) {
             $this->session_id = Cookie::get('apine_session');
         } else {
             $this->session_id = Encryption::token();
         }
     }
     $this->_initialize('apine_sessions', $this->session_id);
 }
Example #2
0
 /**
  * Detect the best language according to language cookie
  *
  * @return Translation
  */
 private static function cookie_best()
 {
     $cookie = Apine\Core\Cookie::get('apine_language');
     $return = null;
     if (Config::get('localization', 'locale_use_cookie') === "yes" && $cookie) {
         $directory = new TranslationDirectory();
         $return = $directory->is_exist_language($cookie);
     }
     return $return;
 }