duplicate key in tiki_sessions - a "solution"
perhaps I'm the only one that encountered this problem so far. it was hard enough just to dig it and "discover" what was causing.
my boss emails me with an error he gets at our front page:

Warning: error: Duplicate entry '5663207e3d6e1adc2b7bbe63b672c365' for key 1 in query: insert into `tiki_sessions`(`sessionId`,`timestamp`,`user`) values(?,?,?) in /home/www/*********/lib/tikidblib.php on line 134
I was like "What the hell?" — after days of trying to recreate the bug (apparently it only happened in an IPv6 env) I find myself reading the damn email again and see this:

... array(3) { [0]=> &string(73) "insert into `tiki_sessions`(`sessionId`,`timestamp`,`user`) values(?,?,?)" [1]=> &array(3) { [0]=> ----> HERE <----- string(40) "5663207e3d6e1adc2b7bbe63b672c36583f32c3f" [1]=> int(1134482295) [2]=> NULL } ...
And I see that the string for the SESSID is differente from above. After looking at the tiki_sessions structure, I realize it's a VARCHAR(32)...
I checked too that update_session() from tiki first tries to delete the key and then reinsert.
So, after some tests this is what was actually happening:
Boss access webpage — tiki tries to insert a 40 chars long string and mysql truncates it to 32 chars but inserts
Boss reloads webpage — tiki tries to delete a 40 chars long string from table (it doesn't exist and don't generate an error!!!!!)
tiki tries to insert the 40 chars long string but mysql truncates it to 32 chars long and whines about already existing one key — NOW there's an error.
My solution: I changed my tiki_sessions table so sessionId is a VARCHAR(40) instead of 32.
I think this is probably a PHP bug but I haven't checked it yet.
I just want to know if this solution will affect any other thing (I personally think it won't).
I hope I explained my problem and "solution" fairly well
php version: 4.3.10
tiki: 1.8.6
apache: 2.0.54