BLOG

Login problems with domain redirections and cookies

Well, it turns out that if you are setting your $cookie_domain in the settings.php file, and you also want to use domain redirection to point your www site to your non-www site [for SEO purposes] your cookie_domain setting in your settings.php file will need to be edited.
 
The settings.php file says to set it as follows:
 
$cookie_domain = "example.com"
 
However you need to add a DOT to the front of it!
 
$cookie_domain = ".example.com"
 
Or you will NOT be able to log in!
 
Why set the cookie domain?
 
Well if you want to use the built-in file uploader, you will need to set the cookie domain, I'm sure there are other needs for it, so you can't just turn it off in all cases.
 
Hope this entry will help someone out there with this problem!