Implemented htacess rewrite to enforce the word "www" in my web site URL. I did not pay much attention to this. I guess this was giving me some problems. For the pages maintaining sessions, khngai.com and www.khngai.com are having two different sessions.
My method of resolving this :
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.[^\.]+\.[^\.]+$ [NC]
RewriteCond %{HTTP_HOST} ([^\.]+\.[^\.]+)$
RewriteRule ^cgi-bin/php[3-9]?-cgi[^/]*/(.*)$ http://www.%1/$1 [L,R=301]
RewriteCond %{HTTP_HOST} !^www\.[^\.]+\.[^\.]+$ [NC]
RewriteCond %{HTTP_HOST} ([^\.]+\.[^\.]+)$
RewriteRule ^(.*)$ http://www.%1/$1 [L,R=301]
The first 3 lines are very specific to my web hosting company.
My web hosting company also complained that 2 of my scripts are loading its server. One of the scripts is to generate PNG image dynamically. I have to stop using that script and pre-generate all the images. I am not entirely happy, but I am glad that they bother to find out what are loading its server.