fixing problems related to subdomain, redirecting, and cookies