[cgiapp] Odd little bug

Jerry Kaidor jerry at tr2.com
Tue Jul 13 10:27:52 EDT 2010


Hello,

   During development of my "tryit" application, I encountered a strange
little thing that CAP::Session seems to be doing.   It is corrupting
the auto-increment index of my "sessions" table.    To work around it
while doing other stuff, I eliminated the config of Session, which then
defaulted to using a file.  But now I'm going back to it.

   My auto-increment index is called "ID".  Session commandeers it and
changes it to a goofy number.  Session does not like little,
well-behaved numbers for it's session ID.  Probably a security
precaution.

   For example, the ID had gotten to 1140.  When I enabled CAP::Session
sql usage and tried to log in, it set it to 884812525, which is
0x34BD2AED.  Tried to log in again, it incremented to 884812526, which
is normal, but what was wrong with 1141?  A couple times these
shenanegans actually killed
mysql's auto-incrementer (at least for this table).  I'm betting that the
number went negative for mysql's internal wordlength....

   The sessions table is also used by my old code, and these large numbers
break it.  Is there any way to tell CAP::Session to not initialize the
auto-increment ID field?

  Thanks in advance,

                           - Jerry Kaidor




More information about the cgiapp mailing list