summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGábor Hojtsy2012-01-23 12:40:00 (GMT)
committer Gábor Hojtsy2012-01-23 12:40:00 (GMT)
commit8d060bc4720f308f580b5610a805a4099fbaa598 (patch)
treec89135077c2151336d047deb6f67b7665f7db6ab
parent52150fe0f3692f249e31d31680abf6a830feab1d (diff)
Issue #825972 by daniels220, Reidsy, Albert Volkman: add phpdoc documentation to sess_read() and sess_write()
-rw-r--r--includes/session.inc37
1 files changed, 37 insertions, 0 deletions
diff --git a/includes/session.inc b/includes/session.inc
index eaf6fc5..9f671b3 100644
--- a/includes/session.inc
+++ b/includes/session.inc
@@ -13,6 +13,25 @@ function sess_close() {
return TRUE;
}
+/**
+ * Reads an entire session from the database (internal use only).
+ *
+ * Also initializes the $user object for the user associated with the session.
+ * This function is registered with session_set_save_handler() to support
+ * database-backed sessions. It is called on every page load when PHP sets
+ * up the $_SESSION superglobal.
+ *
+ * This function is an internal function and must not be called directly.
+ * Doing so may result in logging out the current user, corrupting session data
+ * or other unexpected behavior. Session data must always 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.
+ */
function sess_read($key) {
global $user;
@@ -54,6 +73,24 @@ function sess_read($key) {
return $user->session;
}
+/**
+ * Writes an entire session to the database (internal use only).
+ *
+ * This function is registered with session_set_save_handler() to support
+ * database-backed sessions.
+ *
+ * This function is an internal function and must not be called directly.
+ * Doing so may result in corrupted session data or other unexpected behavior.
+ * Session data must always 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;