/** * @param array $session_vars An array of values that set how the class functions. * -'cookie_path' _string_: The path where the cookie is to be stored * -'cookie_domain' _string_: The domain the that the cookie resides on * -'cookie_secure' _boolean_: Access the cookie only over an secure connection * -'cookie_httponly' _boolean_: Write to the cookie only over an http(s) connection * -'cookie_lifetime' _int_: The amount of time the cookie is active for * -'hash_cookie' _boolean_ :Hash the cookie to its value is not easily readable * -'hash_session' _boolean: Has a season so its value is not easily readable * -'session_name' _string_ : Name of the current session * -'session_lifetime' _int_: The life time of the session, in seconds * -'session_path' _string_: The path of the session. * -'session_domain' _string_: The domain of the session. Default is current. * -'session_secure'_boolean_: Access the session only over a secure connection * -'session_httponly' _boolean: Writes to the session only over an http connection * -'hash_storage_key' _boolean: Session/Cookie Storage key will be hashed. * -'storage_key' _string: Session/Cookie Key to Store Like Data */ public function __construct($vars = array()) { $defaults = array('cookie_path' => '/', 'cookie_domain' => $_SERVER['HTTP_HOST'], 'cookie_secure' => false, 'cookie_httponly' => false, 'cookie_lifetime' => time() + 30 * 24 * 60, 'hash_storage_key' => true, 'session_lifetime' => 2000, 'session_path' => '/', 'session_domain' => $_SERVER['HTTP_HOST'], 'session_secure' => false, 'session_httponly' => false, 'session_start' => true, 'storage_key' => 'social_like_locker_data'); $vars += $defaults; self::$cookie_path = $vars['cookie_path']; self::$cookie_domain = $vars['cookie_domain']; self::$cookie_secure = $vars['cookie_secure']; self::$cookie_httponly = $vars['cookie_httponly']; self::$cookie_lifetime = $vars['cookie_lifetime']; self::$session_path = $vars['session_path']; self::$session_domain = $vars['session_domain']; self::$session_secure = $vars['session_secure']; self::$session_httponly = $vars['session_httponly']; self::$session_lifetime = $vars['session_lifetime']; self::$hash_storage_key = $vars['hash_storage_key']; $this->storage_key = $vars['storage_key']; $this->_initSession(); }