Forum Moderators: open
I hope someone can help me put with a bit a problem I have hanging around.
Let me explain how it all happened...
I made a lot of searches trough the net trying to find the solution, but, without success. I hope someone can help me out on this, on how to make and retrive the same cookie no matter if you are in "www.mysite.com" or "mysite.com".
All help is very appreciated...
THANKS
AFAIK, you can't change the cookie-handling of client browsers. This is for security reasons.
The simplest solution (IMHO) is to not allow the use of multiple domain names. Instead, detect accesses to any secondary domain names, and 301-redirect them to your primary domain. Using this technique, no cookie can be set in the wrong domain. It also has the added benefit of reducing the number of incoming links to secondary doamins, concentrating link popularity and Google PageRank into the primary domain.
You can do this using client- or server-side scripting, or implement it at the server level, which is much more efficient.
Jim
Of course, redirecting to one primary name as jdMorgan suggests is also a good idea, for this and a number of other reasons.