Simba, Sir i am Replace to your code in login.php line 70
setcookie("cuid", $cuid, time() 3600 * 24 * 365, "/", ".my_site.com");
setcookie("cups", $cups, time() 3600 * 24 * 365, "/", ".my_site.com");and paste your 2nd Code in my /.htaccess file
%{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://my_site.com/$1 [R=301,L]But dont working my www tab .