diff options
author | Dries Buytaert <dries@buytaert.net> | 2006-02-17 11:10:49 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2006-02-17 11:10:49 +0000 |
commit | dd2109fcb99a512efaf8c0ea30a309a780b60531 (patch) | |
tree | ffb1b27fba6179272835b3f537bfd5e55e7c96bf /includes/session.inc | |
parent | 62b610d8d9a77133288b7af3cd5f7b1fcbb0cc3d (diff) | |
download | brdo-dd2109fcb99a512efaf8c0ea30a309a780b60531.tar.gz brdo-dd2109fcb99a512efaf8c0ea30a309a780b60531.tar.bz2 |
- Pach #44947 by Moshe: fixed bug with session handling.
Diffstat (limited to 'includes/session.inc')
-rw-r--r-- | includes/session.inc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/includes/session.inc b/includes/session.inc index 48938d2ca..bb9cc8900 100644 --- a/includes/session.inc +++ b/includes/session.inc @@ -53,8 +53,12 @@ function sess_write($key, $value) { $result = db_query("SELECT sid FROM {sessions} WHERE sid = '%s'", $key); if (!db_num_rows($result)) { - // Only save session data when there is session data available. - if ($user->uid || $value) { + // Only save session data when when the browser sends a cookie. This keeps + // crawlers out of session table. This improves speed up queries, reduces + // memory, and gives more useful statistics. We can't eliminate anonymous + // session table rows without breaking throttle modulee and "Who's Online" + // block. + if ($user->uid || $value || count($_COOKIE)) { db_query("INSERT INTO {sessions} (sid, uid, cache, hostname, session, timestamp) VALUES ('%s', %d, %d, '%s', '%s', %d)", $key, $user->uid, $user->cache, $_SERVER["REMOTE_ADDR"], $value, time()); } } |