If anyone could answer this I'd really appreciate it. I've been trying to track the issue for months and still not been able to figure out what is keeping a user from being able to log in to my site from "http://www.domainexample.com".

Right now people can only login and remain logged in by entering "http://domainexample.com". If they put the "www" in there they're not seen as logged in. It's a 'small' problem, but a really annoying one, too...

Comments

frjo’s picture

One way to fix it is to use mod_rewrite so when people go to www.domainexample.com they are redirected to domainexample.com.

Just after the line "RewriteEngine on" in your .htaccess file you add this:

# Remove www
RewriteCond %{HTTP_HOST} ^www\.domainexample\.com$ [NC]
RewriteRule ^(.*)$ http://domainexample.com/$1 [R=permanent,L]
crunchywelch’s picture

You can change it in the settings.php file for your site, there is a section with a bunch of ini_set( commands. Add one that says:

ini_set('session.cookie_domain', '.domainexample.com');

And then all subdomains will use the same session cookie, and solve the problem of a different session being used for each subdomain, which is what you are experiencing.

flufftronix’s picture

yes! amazing. i was having this problem too, and had no idea how to fix it. thanks!

neelan’s picture

It works. i was frustrated to solve this issue. but your help made me happy. thanks sir.

calebgilbert’s picture

...frjo and crunchywelch - this is really great that I've got a solution to this. You guys rock. :-)

Political Physics