+ if ($user) {
+ $value = json_encode(array("uid" => $user["uid"],
+ "hash" => cookie_hash($user),
+ "ip" => $_SERVER['REMOTE_ADDR']));
+ } else {
+ $value = "";
+ }
+
+ setcookie("Friendica", $value, $time, "/", "", (Config::get('system', 'ssl_policy') == SSL_POLICY_FULL), true);
+}
+
+/**
+ * @brief Sets the provided user's authenticated session
+ *
+ * @todo Should be moved to Friendica\Core\Session once it's created
+ *
+ * @param type $user_record
+ * @param type $login_initial
+ * @param type $interactive
+ * @param type $login_refresh
+ */
+function authenticate_success($user_record, $login_initial = false, $interactive = false, $login_refresh = false)
+{