diff -r 274c193231b9 trac/web/auth.py
--- a/trac/web/auth.py	Thu Nov 15 14:26:47 2007 +0100
+++ b/trac/web/auth.py	Wed Nov 21 17:40:45 2007 +0100
@@ -158,9 +158,11 @@ class LoginModule(Component):
         # cookies older than 10 days
         db = self.env.get_db_cnx()
         cursor = db.cursor()
+        # QUESTION: why to logout from other ip-s? ulr1 071121 
         cursor.execute("DELETE FROM auth_cookie WHERE name=%s OR time < %s",
                        (req.authname, int(time.time()) - 86400 * 10))
         db.commit()
+
         self._expire_cookie(req)
         custom_redirect = self.config['metanav'].get('logout.redirect')
         if custom_redirect:
@@ -179,6 +181,8 @@ class LoginModule(Component):
     def _get_name_for_cookie(self, req, cookie):
         db = self.env.get_db_cnx()
         cursor = db.cursor()
+        # WORKAROUND: http://trac.edgewall.org/ticket/6121 ulr1 071121  
+        db.commit()
         if self.check_ip:
             cursor.execute("SELECT name FROM auth_cookie "
                            "WHERE cookie=%s AND ipnr=%s",

