+/**
+ * @brief Kills the "Friendica" cookie and all session data
+ */
+function nuke_session() {
+
+ new_cookie(-3600); // make sure cookie is deleted on browser close, as a security measure
+ session_unset();
+ session_destroy();
+}
+
+/**
+ * @brief Calculate the hash that is needed for the "Friendica" cookie
+ *
+ * @param array $user Record from "user" table
+ *
+ * @return string Hashed data
+ */