MySQL wait_timeout setting ignored
My immediate suspicion is that there is another my.cnf present on the system. You should run 

locate my.cnf


and see if the reports multiple my.cnf files

If there is only one my.cnf, then my.cnf is most likely in the wrong folder.

It should be in one of the following places


/etc/my.cnf
/etc/mysql/my.cnf
/var/lib/mysql/my.cnf
~/my.cnf


Please check for these. Remove extras.