<?xml version="1.0" encoding="UTF-8"?> 
<?xml-stylesheet href="https://dev.horde.org/themes/horde//default/feed-rss.xsl" type="text/xsl"?> 
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> 
 <channel> 
  <title>Left Logout button throws &quot;malicious request&quot;</title> 
  <pubDate>Fri, 10 Apr 2026 13:26:30 +0000</pubDate> 
  <link>https://bugs.horde.org/ticket/7931</link> 
  <atom:link rel="self" type="application/rss+xml" title="Left Logout button throws &quot;malicious request&quot;" href="https://bugs.horde.org/ticket/7931/rss" /> 
  <description>Left Logout button throws &quot;malicious request&quot;</description> 
 
   
   
  <item> 
   <title>When I log in into our horde Webmail AND log out, immediatel</title> 
   <description>When I log in into our horde Webmail AND log out, immediately, i got the



&quot;We cannot verify that this request was really sent by you. It could be a malicious request. If you intended to perform this action, you can retry it now.&quot;



message.



This only happens with the &quot;logout&quot; button from the left frame menu. The &quot;logout&quot; button in the head bar always works.



Probably there is something wrong with the &quot;horde_logout_token&quot;, within registration.



To watch the error, please follow these steps exactly:

1. ) Log in to your horde framework

2.) Push the &quot;logout&quot; Button in the left frame  (last one)

3. ) You get the message about &quot;malicious request&quot;, mentioned above,

AND you are not logged out correctly (session still alive)



1. ) Log in to your horde framework

2.) Push a button like Webmail/Inbox

3.) Push the &quot;logout&quot; Button in the left frame  (last one)

4. ) Your are logged out correctly

</description> 
   <pubDate>Mon, 02 Feb 2009 09:51:33 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7931#t52199</link> 
  </item> 
   
  <item> 
   <title>I can&#039;t reproduce this.</title> 
   <description>I can&#039;t reproduce this.</description> 
   <pubDate>Tue, 10 Feb 2009 17:02:46 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7931#t52458</link> 
  </item> 
   
  <item> 
   <title>hmm, i can reproduce this since several horde webmail versio</title> 
   <description>hmm, i can reproduce this since several horde webmail versions.

We use IMP (dovecot IMAP) as authenticate handler, perhaps that is a difference.



&gt; I can&#039;t reproduce this.

</description> 
   <pubDate>Wed, 11 Feb 2009 08:56:33 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7931#t52479</link> 
  </item> 
   
  <item> 
   <title>I don&#039;t see this either, and I don&#039;t see any other user repo</title> 
   <description>I don&#039;t see this either, and I don&#039;t see any other user reports.</description> 
   <pubDate>Mon, 02 Mar 2009 23:18:59 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7931#t52849</link> 
  </item> 
   
  <item> 
   <title>I&#039;ve seen it sporadically for a while now, when logging out </title> 
   <description>I&#039;ve seen it sporadically for a while now, when logging out as I recall.  I just had a user report it, which is why I&#039;m looking into it again.



I have not been able to reproduce it at will though.</description> 
   <pubDate>Tue, 03 Mar 2009 17:58:43 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7931#t52867</link> 
  </item> 
   
  <item> 
   <title>I&#039;m able to reproduce the issue on my system.

The problem o</title> 
   <description>I&#039;m able to reproduce the issue on my system.

The problem only occours using the sql driver for sessionhandler in conf.php and only clicking on the &quot;Logout&quot; item in the left bar (using the logout button on the top is okay).

I&#039;m using Horde Groupware Webmail Edition 1.2.2 with Postgresql 8.2.

Let me know if you need more info.</description> 
   <pubDate>Tue, 10 Mar 2009 07:54:57 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7931#t52992</link> 
  </item> 
   
  <item> 
   <title>Yes, you are right!

We are using custom, sql-based session </title> 
   <description>Yes, you are right!

We are using custom, sql-based session handler, too. (MySQL 5.0.51).



If i change session handler to default PHP file-based, there is no error.



</description> 
   <pubDate>Tue, 10 Mar 2009 08:23:16 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7931#t52993</link> 
  </item> 
   
  <item> 
   <title>I can&#039;t reproduce this with the MySQL session handler either</title> 
   <description>I can&#039;t reproduce this with the MySQL session handler either.</description> 
   <pubDate>Tue, 10 Mar 2009 09:15:06 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7931#t52999</link> 
  </item> 
   
  <item> 
   <title>Just in case it could be useful, i&#039;m using

php-5.2.8

PEAR-</title> 
   <description>Just in case it could be useful, i&#039;m using

php-5.2.8

PEAR-MDB2_Driver_pgsql-1.5.0_beta1

PEAR-MDB2-2.5.0_beta1



i don&#039;t know if it&#039;s a Postgresql related issue or a more generic db-agnostic one.

It should be interesting to understand why the bug only trigger when using the left logout button and not the one in the top bar: is logout managed differently in the left/top buttons ?

</description> 
   <pubDate>Tue, 10 Mar 2009 09:36:14 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7931#t53000</link> 
  </item> 
   
  <item> 
   <title>Installed Software 

--------------------------

* RHEL5 RPM</title> 
   <description>Installed Software 

--------------------------

* RHEL5 RPM Installations

  Apache 2.2

  PHP v5.1.6

  MySQL 5.0.45 



* Horde Groupware Webmail Edition (version 1.2.2)

  http://ftp.horde.org/pub/horde-webmail/horde-webmail-1.2.2.tar.gz 

	

* Memcached (version 1.2.6)

  http://www.danga.com/memcached/download.bml



* Memcache PHP Module (version 2.2.5)

  http://pecl.php.net/package/memcache

   



Configuration

--------------------

* Database =&gt; MySQL 

* Authentication =&gt; imp

* Session Handler =&gt; Default PHP Session Handler



* /etc/php.ini 

  Using the default /etc/php.ini file with the recommended additional or

  modified lines to support the Memcache Session Handler.

  

  [NOTE: Many of these settings are quite short in order to test behavior.]



  extension=memcache.so

  session.save_handler = memcache

  session.save_path = &quot;tcp://localhost:11211&quot;

  session.use_cookies = 1

  session.use_only_cookies = 1

  session.name = PHPSESSID

  session.auto_start = 0

  session.cookie_lifetime = 300

  session.gc_probability = 1

  session.gc_divisor = 1

  session.gc_maxlifetime = 122



  expose_php = Off

  display_errors = Off            (default)

  log_errors = On                 (default)

  register_globals = Off          (default)



* /etc/php.d/memcache.ini

  memcache.allow_failover = 1

  memcache.max_failover_attempts = 20

  memcache.chunk_size = 8192

  memcache.default_port = 11211

  memcache.hash_strategy = standard

  memcache.hash_function = crc32



* I am currently running the Memcached daemon in the foreground, so that I 

  could better understand see the dialogue between the application and

  the server.



Problem

------------

* Thus far, everything seems to work until I attempt to log out.

* If I click on an application in the sidebar and then click on the &quot;Log out&quot;

  icon at the top of the frame, log out is successful.  The displayed URL is:



https://hostname/imp/login.php?horde_logout_token=&lt;tokenstring&gt;=horde&amp;logout_reason=logout



* If I click on the &quot;Log out&quot; in the side bar, I receive the error:



        We cannot verify that this request was really sent by you. It could 

        be a malicious request. If you intended to perform this action, 

        you can retry it now.  



  The displayed URL is:



https://hostname/login.php?horde_logout_token=&lt;tokenstring&gt;=horde&amp;logout_reason=logout



  However, if I modify the URL and change it to (Please, notice the only 

  change being the addition of &quot;imp&quot; to the URL):



https://hostname/imp/login.php?horde_logout_token=&lt;tokenstring&gt;=horde&amp;logout_reason=logout



  , it then successfully logs out.



 

* I have tracked down the code which is responsible for the error.  It is

  located in the &#039;checkRequestToken&#039; function in the file,

  &lt;Horde root directory&gt;/lib/Horde.php



--------------------------------------------

function checkRequestToken($slug, $token)

    {

        if (empty($_SESSION[&#039;horde_form_secrets&#039;][$token])) {

            return PEAR::raiseError(_(&quot;We cannot verify that this request was really sent by you. It could be a malicious request. If you intended to perform this action, you can retry it now.&quot;));

        }



        if (($_SESSION[&#039;horde_form_secrets&#039;][$token] + $GLOBALS[&#039;conf&#039;][&#039;urls&#039;][&#039;token_lifetime&#039;] * 60) &lt; time()) {

            return PEAR::raiseError(sprintf(_(&quot;This request cannot be completed because the link you followed or the form you submitted was only valid for %s minutes. Please try again now.&quot;), $GLOBALS[&#039;conf&#039;][&#039;urls&#039;][&#039;token_lifetime&#039;]));

        }



        return true;

    }

--------------------------------------------



* When I used the Horde Memcache Session Handler, all &quot;Log outs&quot; (icon

  and sidebar) worked.  However, the Horde Memcache Session Handler does

  not include an expiration on the session in the communication with

  the Memcached daemon, which is something we require.

</description> 
   <pubDate>Mon, 23 Mar 2009 13:36:50 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7931#t53233</link> 
  </item> 
   
  <item> 
   <title>I have the same problem...



When I use the logout on head </title> 
   <description>I have the same problem...



When I use the logout on head bar it only work if I&#039;m in IMP if I&#039;m in the main horde section I get the error message.



I can reproduce it anytime



&gt; When I log in into our horde Webmail AND log out, immediately, i got the

&gt;

&gt; &quot;We cannot verify that this request was really sent by you. It could 

&gt; be a malicious request. If you intended to perform this action, you 

&gt; can retry it now.&quot;

&gt;

&gt; message.

&gt;

&gt; This only happens with the &quot;logout&quot; button from the left frame menu. 

&gt; The &quot;logout&quot; button in the head bar always works.

&gt;

&gt; Probably there is something wrong with the &quot;horde_logout_token&quot;, 

&gt; within registration.

&gt;

&gt; To watch the error, please follow these steps exactly:

&gt; 1. ) Log in to your horde framework

&gt; 2.) Push the &quot;logout&quot; Button in the left frame  (last one)

&gt; 3. ) You get the message about &quot;malicious request&quot;, mentioned above,

&gt; AND you are not logged out correctly (session still alive)

&gt;

&gt; 1. ) Log in to your horde framework

&gt; 2.) Push a button like Webmail/Inbox

&gt; 3.) Push the &quot;logout&quot; Button in the left frame  (last one)

&gt; 4. ) Your are logged out correctly

&gt;

</description> 
   <pubDate>Mon, 25 May 2009 16:56:45 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7931#t54297</link> 
  </item> 
   
  <item> 
   <title>&gt; * When I used the Horde Memcache Session Handler, all &quot;Log</title> 
   <description>&gt; * When I used the Horde Memcache Session Handler, all &quot;Log outs&quot; (icon

&gt;   and sidebar) worked.  However, the Horde Memcache Session Handler does

&gt;   not include an expiration on the session in the communication with

&gt;   the Memcached daemon, which is something we require.



So, are you saying that this only happens if you configure a custom session in handler in the *PHP* configuration (as opposed to the Horde configuration)?

Is this what the other reporters are using too?</description> 
   <pubDate>Sun, 07 Jun 2009 10:00:35 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7931#t54458</link> 
  </item> 
   
  <item> 
   <title>In my php.ini I have:



session.save_handler = files



no </title> 
   <description>In my php.ini I have:



session.save_handler = files



no special config from the default



&gt;&gt; * When I used the Horde Memcache Session Handler, all &quot;Log outs&quot; (icon

&gt;&gt;   and sidebar) worked.  However, the Horde Memcache Session Handler does

&gt;&gt;   not include an expiration on the session in the communication with

&gt;&gt;   the Memcached daemon, which is something we require.

&gt;

&gt; So, are you saying that this only happens if you configure a custom 

&gt; session in handler in the *PHP* configuration (as opposed to the 

&gt; Horde configuration)?

&gt; Is this what the other reporters are using too?

</description> 
   <pubDate>Sun, 07 Jun 2009 16:02:12 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7931#t54462</link> 
  </item> 
   
  <item> 
   <title>I fixed my problem...



In the Custom session Handler I cho</title> 
   <description>I fixed my problem...



In the Custom session Handler I choose &quot;Use the default PHP session handler (file-based by default)&quot; instead of mysql (that I selected when I install horde)



now, all logout button works perfectly.



hope my hint will help others...



&gt; In my php.ini I have:

&gt;

&gt; session.save_handler = files

&gt;

&gt; no special config from the default

&gt;

&gt;&gt;&gt; * When I used the Horde Memcache Session Handler, all &quot;Log outs&quot; (icon

&gt;&gt;&gt;   and sidebar) worked.  However, the Horde Memcache Session Handler does

&gt;&gt;&gt;   not include an expiration on the session in the communication with

&gt;&gt;&gt;   the Memcached daemon, which is something we require.

&gt;&gt;

&gt;&gt; So, are you saying that this only happens if you configure a custom

&gt;&gt; session in handler in the *PHP* configuration (as opposed to the

&gt;&gt; Horde configuration)?

&gt;&gt; Is this what the other reporters are using too?

&gt;

</description> 
   <pubDate>Sun, 07 Jun 2009 19:10:08 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7931#t54463</link> 
  </item> 
   
  <item> 
   <title>At the time that I posted my addition to this bug report, th</title> 
   <description>At the time that I posted my addition to this bug report, the answer to

Jan&#039;s question was &quot;yes&quot;.  I was using the Memcache Session Handler (not

Horde Memcache Session Handler) which was through the specification of

it in the php.ini file.



However, since that time, I have also been experimenting with the Horde

MySQL session handler.  I have also experienced the same behavior.

However, I have been able to isolate the behavior a little more.



I don&#039;t know whether it would be construed as a bug or just undesirable

behavior which is understandable.



Installed Software

------------------



* RHEL5 RPM Installations

  Apache 2.2

  PHP 5.1.6

  MySQL 5.0.45



* Horde Groupware Webmail edition (version 1.2.3)

  Configured to use Horde MySQL session handler



Configuration

-------------

* Database =&gt; MySQL

* Authentication =&gt; Imp

* Session Handler =&gt; Horde MySQL Session Handler



Steps (run from a Linux desktop)

-----

1. Connect to Webmail and successfully authenticate.



2. Let the session remain idle gc_maxlifetime and have garbage collection

   take place.  (So the session ID associated with Step #1 is removed from

   the horde_sessionhandler table).



3. Open another browser window, running on the SAME desktop, and log in 

   using the SAME login.



4. Now click on the &quot;Logout&quot; button associated with the idle session 

   established in Step #1.  The browser will return a page stating 



      &quot;We cannot verify that this request was really sent by you. It

       could be a malicious request. If you intended to perform this

       action, you can retry it now.&quot;



5. If instead, you click on any other button, things continue as normal,

   but I think that it is operating off of the new session ID (and

   cookie) associated with the session established in Step #3.



If I perform Step #3 from the SAME desktop and use a DIFFERENT login from

that which was used in Step #1, the logout and all other operations work,

meaning that the session (from Step #1) is automatically logged out.



If I perform Step #3 from a different desktop and use the SAME login as in

Step #1, the logout and all other operations also work.



Does this make sense?  I can try to further explain, if necessary.



Please note:  I have not gone back to my Memcache configuration to verify

              if the pattern that I have found with MySQL also applies to

              the Memcache scenario that I documented before.

</description> 
   <pubDate>Thu, 11 Jun 2009 15:17:05 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7931#t54539</link> 
  </item> 
   
  <item> 
   <title>I originally noted the error while using the MySQL session h</title> 
   <description>I originally noted the error while using the MySQL session handler, but have since changed to memcache.  Both throw the error unpredictably for me.</description> 
   <pubDate>Thu, 11 Jun 2009 17:43:05 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7931#t54543</link> 
  </item> 
   
  <item> 
   <title>See also ticket #7618.</title> 
   <description>See also ticket #7618.</description> 
   <pubDate>Tue, 30 Jun 2009 18:44:23 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7931#t54752</link> 
  </item> 
   
  <item> 
   <title>Just so that you know there are more of us out there, I have</title> 
   <description>Just so that you know there are more of us out there, I have the same exact problem where the logout from the tree gives me the same error.  I am using a user defined session handler that has a persistent MySQL connection.</description> 
   <pubDate>Thu, 23 Jul 2009 23:44:14 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7931#t55032</link> 
  </item> 
   
  <item> 
   <title>I upgraded my server (not because of this issue) from Apache</title> 
   <description>I upgraded my server (not because of this issue) from Apache 2.0.59/php5.2.0 to Lighttpd 1.4.23/php 5.2.10 and I have no longer seen this issue.  My horde configuration was not changed.</description> 
   <pubDate>Fri, 24 Jul 2009 00:52:53 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7931#t55033</link> 
  </item> 
   
  <item> 
   <title>Thanks Rick, I upgraded my CentOS 5.3 to the latest patches </title> 
   <description>Thanks Rick, I upgraded my CentOS 5.3 to the latest patches and the problem is now resolved.</description> 
   <pubDate>Sat, 25 Jul 2009 03:26:49 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7931#t55049</link> 
  </item> 
   
  <item> 
   <title>I agree: with php 5.2.10 it works. But I have to set



$con</title> 
   <description>I agree: with php 5.2.10 it works. But I have to set



$conf[&#039;sessionhandler&#039;][&#039;params&#039;][&#039;persistent&#039;] = false;



otherwise it locks table just after login:



2009-07-27T08:42:12.977668+02:00  HORDE[7639]: [horde] Error retrieving session data (id = jrulbam7sks33etj0lbc8dpba6): Lock wait timeout exceeded; try restarting transaction [pid 7639 on line 144 of &quot;horde-webmail-1.2.3/lib/Horde/SessionHandler/mysql.php&quot;]



Mysql has innodb horde_sessionhandler table. I set also

$conf[&#039;sessionhandler&#039;][&#039;params&#039;][&#039;rowlocking&#039;] = true;

and I use TCP to connect.



So mysql session handler doesn&#039;t work with persistent connections.</description> 
   <pubDate>Mon, 27 Jul 2009 08:30:05 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7931#t55054</link> 
  </item> 
   
  <item> 
   <title>&gt; So mysql session handler doesn&#039;t work with persistent conn</title> 
   <description>&gt; So mysql session handler doesn&#039;t work with persistent connections.



Can you try if it works with either persistent connections or rowlocking turned off?</description> 
   <pubDate>Mon, 03 Aug 2009 15:25:22 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7931#t55162</link> 
  </item> 
   
  <item> 
   <title>Ping?</title> 
   <description>Ping?</description> 
   <pubDate>Tue, 18 Aug 2009 13:33:09 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7931#t55366</link> 
  </item> 
   
  <item> 
   <title>Sorry about that.  In regards to the behavior when using the</title> 
   <description>Sorry about that.  In regards to the behavior when using the MySQL session handler, we are not currently using persistent connections.  We are, however, using row-level locking.  I will have to modify a few things in order to try it without row-level locking.



Hopefully, I can quickly get that information to you.

</description> 
   <pubDate>Tue, 18 Aug 2009 15:10:49 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7931#t55378</link> 
  </item> 
   
  <item> 
   <title>Any update?</title> 
   <description>Any update?</description> 
   <pubDate>Tue, 01 Sep 2009 11:08:06 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7931#t55628</link> 
  </item> 
   
  <item> 
   <title>I now have an update.  To test the &#039;rowlocking&#039; component of</title> 
   <description>I now have an update.  To test the &#039;rowlocking&#039; component of your 

question, I had a few changes to make to the database side as well 

as the application&#039;s configuration.



We do not use persistent connections.  With rowlocking turned off, the 

behavior does still occur.

</description> 
   <pubDate>Tue, 01 Sep 2009 20:36:19 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7931#t55636</link> 
  </item> 
   
  <item> 
   <title>&gt; We do not use persistent connections.  With rowlocking tur</title> 
   <description>&gt; We do not use persistent connections.  With rowlocking turned off, the

&gt; behavior does still occur.



So, we&#039;re back to start, it has nothing to do with either rowlocking or persistent connections. There is still no common scheme when this happens.</description> 
   <pubDate>Fri, 04 Sep 2009 10:45:17 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7931#t55658</link> 
  </item> 
   
  <item> 
   <title>I only notice that into administration setting &#039;admin/sessio</title> 
   <description>I only notice that into administration setting &#039;admin/sessions.php&#039; I can&#039;t see any session references.

Page stays waiting forever after I click.

This happens with last horde-webmail-1.2.4 and mysql session handler, rowlocking, not persistent, INNODB table.</description> 
   <pubDate>Wed, 16 Sep 2009 11:32:13 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7931#t55775</link> 
  </item> 
   
  <item> 
   <title>&gt; I only notice that into administration setting &#039;admin/sess</title> 
   <description>&gt; I only notice that into administration setting &#039;admin/sessions.php&#039; I 

&gt; can&#039;t see any session references.

&gt; Page stays waiting forever after I click.

&gt; This happens with last horde-webmail-1.2.4 and mysql session handler, 

&gt; rowlocking, not persistent, INNODB table.



Maybe there was some oddity in mysql sessionhandler table, or during upgrade. I empty session-handler table and now admin/sessions.php works fine.

Sorry for noise...

Regards </description> 
   <pubDate>Fri, 18 Sep 2009 12:21:04 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7931#t55829</link> 
  </item> 
   
  <item> 
   <title>Hello.



I have been struggling with a problem similar this</title> 
   <description>Hello.



I have been struggling with a problem similar this for a few days: basically a non-very-deterministic behavior of the two logout links with the horde_logout_token in the main page. My scenario is Horde 3.3.5 using MS SQL Server as session data storage through PEAR&#039;s DB abstraction layer.



Maybe this could give some ideas to others with the same problem, and I think it could be at least a bug report and fix for my specific situation.



Finally it seems to turn out that it is a race condition problem during the situations of simultaneous update of the session_data, because of DB transaction mechanisms that are not so obvious in their inner working in PEAR DB. The first thing that I noticed is that the problem arose in reloads of the main page, which has two frames, each one with a logout button with a horde_logout_token (those values are stored in the session_data field as &quot;horde_form_secrets&quot;). If you reload first one frame, then the other, everything works as expected (slow down one of the participants in the race so no problems appear :-) ).



PEAR DB uses the concept of autocommit as a way of start automatically a transaction, but the real transaction (issuing the &quot;BEGIN TRANSACTION&quot; to the DB) starts just with a so called &quot;manipulation query&quot; (INSERT, UPDATE, DELETE). That means that the intended atomic process:



 1. Read session data from DB

 2. Update session data in DB



is not actually a transaction, because the BEGIN TRANSACTION starts in the 2nd step.

That leads to a situation with no atomicity and hence a really nice &quot;race condition&quot; with not so really nice results.



As I didn&#039;t plan to fix anything in PEAR DB, I found a workaround that could be acceptable, even if it&#039;s not the most elegant way. 



I forced a &quot;manipulation query&quot; in the _read() function at lib/Horde/SessionHandler/sql.php just before the 1st step of obtaining the session data, in order to force the begin of the transaction:



        /* Force manipulation query to effectively begin the transaction */

        $table = $this-&gt;_params[&#039;table&#039;];

        $updatestring = &#039;session_id=session_id&#039;;

        $wherestring = &#039;session_id = ?&#039;;

        $query = sprintf(&#039;UPDATE %s SET %s WHERE %s&#039;,

                          $table,

                          $updatestring,

                          $wherestring);

        $values[] = $id;

        $result = $this-&gt;_write_db-&gt;query($query, $values);

        if (is_a($result, &#039;PEAR_Error&#039;)) {

            Horde::logMessage($result, __FILE__, __LINE__, PEAR_LOG_ERR);

            return false;

        }



This makes transaction work and no more race condition appeared in my scenario so far.

See patch attached.







</description> 
   <pubDate>Thu, 24 Sep 2009 16:54:11 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7931#t55911</link> 
  </item> 
   
  <item> 
   <title>That&#039;s really a crude hack that I&#039;d rather like to avoid. Do</title> 
   <description>That&#039;s really a crude hack that I&#039;d rather like to avoid. Do you have a word from the DB maintainers whether they consider this a bug? Have you reported this to them?</description> 
   <pubDate>Fri, 25 Sep 2009 14:37:09 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7931#t55949</link> 
  </item> 
   
  <item> 
   <title>I agree on the crudeness of the patch, so I&#039;m going to file </title> 
   <description>I agree on the crudeness of the patch, so I&#039;m going to file a bug in the PEAR DB site :-)</description> 
   <pubDate>Fri, 25 Sep 2009 14:54:43 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7931#t55953</link> 
  </item> 
   
  <item> 
   <title>Can you please post a link to that ticket here?</title> 
   <description>Can you please post a link to that ticket here?</description> 
   <pubDate>Wed, 21 Oct 2009 13:48:23 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7931#t56367</link> 
  </item> 
   
  <item> 
   <title>I&#039;ve got this rather annoying problem, and was wondering whe</title> 
   <description>I&#039;ve got this rather annoying problem, and was wondering whether or not it would be possible to resolve it by locking records during the initial reads using SQL in the following manner:



http://dev.mysql.com/doc/refman/5.0/en/innodb-locking-reads.html



I&#039;m leaning towards a SHARE lock myself as it allows all reads to continue but only the first one to read gets to update, but I&#039;ve not studied when the SQL is issued and whether anything would be blocked awaiting a DB lock if something else holds a lock...



I&#039;m not sure what the PEAR DB library fix would be as they don&#039;t know that an update is imminent unless they&#039;re told so by the code using their library, which is exactly what the above tries to achieve...



&#039;course, PEAR may have some other method for this already but I&#039;m no PEAR expert, indeed, the best solution overall would probably be Optimistic locking but that would probably require significant code changes or adding another library between Horde and the DB...</description> 
   <pubDate>Wed, 21 Oct 2009 15:03:19 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7931#t56374</link> 
  </item> 
   
  <item> 
   <title>experiencing the same type of behavior on logouts on a new i</title> 
   <description>experiencing the same type of behavior on logouts on a new install.   Horde newb, please advise what, if any, additional info you need/want on our configuration.</description> 
   <pubDate>Mon, 16 Nov 2009 19:32:57 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7931#t56756</link> 
  </item> 
   
  <item> 
   <title>Hmm I don&#039;t get this message on logout but I do get it when </title> 
   <description>Hmm I don&#039;t get this message on logout but I do get it when I try to dele SyncML sessions. Maybe related?</description> 
   <pubDate>Thu, 28 Oct 2010 11:29:54 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7931#t60667</link> 
  </item> 
   
  <item> 
   <title>Resolving since H4 doesn&#039;t use frames, and this has been han</title> 
   <description>Resolving since H4 doesn&#039;t use frames, and this has been hanging around.</description> 
   <pubDate>Sat, 19 Mar 2011 02:12:31 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7931#t62460</link> 
  </item> 
   
   
 
 </channel> 
</rss> 
