Mercurial > defr > drupal > core
comparison includes/session.inc @ 13:8b6c45761e01 6.6
Drupal 6.6
author | Franck Deroche <webmaster@defr.org> |
---|---|
date | Tue, 23 Dec 2008 14:32:33 +0100 |
parents | 589fb7c02327 |
children | 4347c45bb494 |
comparison
equal
deleted
inserted
replaced
12:4ca9f57cc4d4 | 13:8b6c45761e01 |
---|---|
1 <?php | 1 <?php |
2 // $Id: session.inc,v 1.44.2.3 2008/09/17 07:53:08 goba Exp $ | 2 // $Id: session.inc,v 1.44.2.4 2008/10/20 09:53:32 goba Exp $ |
3 | 3 |
4 /** | 4 /** |
5 * @file | 5 * @file |
6 * User session handling functions. | 6 * User session handling functions. |
7 */ | 7 */ |
59 // If saving of session data is disabled or if the client doesn't have a session, | 59 // If saving of session data is disabled or if the client doesn't have a session, |
60 // and one isn't being created ($value), do nothing. This keeps crawlers out of | 60 // and one isn't being created ($value), do nothing. This keeps crawlers out of |
61 // the session table. This reduces memory and server load, and gives more useful | 61 // the session table. This reduces memory and server load, and gives more useful |
62 // statistics. We can't eliminate anonymous session table rows without breaking | 62 // statistics. We can't eliminate anonymous session table rows without breaking |
63 // the throttle module and the "Who's Online" block. | 63 // the throttle module and the "Who's Online" block. |
64 if (!session_save_session() || (empty($_COOKIE[session_name()]) && empty($value))) { | 64 if (!session_save_session() || ($user->uid == 0 && empty($_COOKIE[session_name()]) && empty($value))) { |
65 return TRUE; | 65 return TRUE; |
66 } | 66 } |
67 | 67 |
68 db_query("UPDATE {sessions} SET uid = %d, cache = %d, hostname = '%s', session = '%s', timestamp = %d WHERE sid = '%s'", $user->uid, isset($user->cache) ? $user->cache : '', ip_address(), $value, time(), $key); | 68 db_query("UPDATE {sessions} SET uid = %d, cache = %d, hostname = '%s', session = '%s', timestamp = %d WHERE sid = '%s'", $user->uid, isset($user->cache) ? $user->cache : '', ip_address(), $value, time(), $key); |
69 if (db_affected_rows()) { | 69 if (db_affected_rows()) { |