[eluser]Matthieu Fauveau[/eluser]
Hi guys,
I don't know if you noticed it yourself but using Flashdatas and CI native Session library can make several unefficient queries and therefor slow down the loading of your website.
Following is a modified library that will make one SELECT and one UPDATE - if needed - instead of several UPDATE queries.
I'm currently testing it and it seems to work great. Your inputs are obviously welcome.
Matt.
*** UPDATED 2009-03-09 ***
Just noticed that CI stores IP addresses as strings, it's however an unefficient way of storing IP addresses which are basically unsigned 32-bit integer. MySQL will also perform better when doing an integer comparison instead of a string comparison.
The attached file has been updated to take this changes into account. You will need to ALTER your session table using the following command for it to work :
Code:
ALTER TABLE `ci_sessions` CHANGE `ip_address` `ip_address` INT UNSIGNED NOT NULL DEFAULT '0'