Wednesday, May 18, 2011

Joomla voting system - "You have already rated this item" error

Ever tried voting/rating for an article in joomla and found it saying "You have already rated this item"? Well it means that someone else has voted using his or her account with the pc you are using. Joomla's rating/voting system doesn't use user account to avoid vote spaming but rather ip.

Thursday, March 24, 2011

Joomla 1.5 admin session timeout error

Yesterday I was running a script in Joomla admin from a custom developed. The script basically uploaded an xml file and entered the blogs from the xml into the site. It was working fine as look as the number of blog/entries in the file were small but when they were large enough to exceed the default joomla session time of 15 min it used to logout admin during the script and I had to start all over again.

I googled for the solution and easily found out that the way to do it is go to Joomla admin of the site then go to:
Site> Global Configuration> System
and at the right bottom you will see an option 'Session Settings' with a value of 15 minutes in 'Session Lifetime', you can simply change it to whatever you like and you are going.

However now comes the reason for writing the post. What I did was try to make this time unlimited. First I tried using '0 minutes' but I think that also uses the default value of 15 minutes because that also logged me out after some time so I tried using the maximum value by pressing and holding 9 for a while. Then I saved and I got logged out and when I tried to login it didn't let me. Yes my admin was kind of blocked as it wasn't giving me error but not letting me in. I tried entering wrong password and it gave me invalid user/pass error but nothing in case of correct user/password. Luckily it was my local site and not some production one, I looked a lot for the place where this value is saved to overwrite it manually but didn't find anything and finally after about an hour I found that it was in Joomla's root directory file configuration.php with a variable of '$lifetime' almost at the end of the file. I change it to 180 and both the issues resolved i.e. I could log back in to admin and the file was also completed in an hour or two without logging me out in between.

However as we know that session time should be kept as low as possible to avoid security breach.

Hope it helps someone.