diff --git includes/session.inc includes/session.inc index ebba273..06f9f7a 100644 --- includes/session.inc +++ includes/session.inc @@ -14,6 +14,19 @@ function sess_close() { return TRUE; } +/** + * Reads an entire session from the database. + * + * This function should not be called directly. Session data should instead be + * accessed via the $_SESSION superglobal. + * + * @param $key + * The session ID of the session to retrieve. + * + * @return + * The user's session, or an empty string if no session exists (i.e. for + * web crawlers and first-time visitors). + */ function sess_read($key) { global $user; @@ -55,6 +68,20 @@ function sess_read($key) { return $user->session; } +/** + * Writes an entire session to the database. + * + * This function should not be called directly. Session data should instead be + * accessed via the $_SESSION superglobal. + * + * @param $key + * The session ID of the session to write to. + * @param $value + * Session data to write as a serialized string. + * + * @return + * Always returns TRUE. + */ function sess_write($key, $value) { global $user;