Click to See Complete Forum and Search --> : Cookie Trouble


kidd
04-07-2003, 08:02 AM
Hello:

I hope someone can help me put with a bit a problem I have hanging around.

Let me explain how it all happened...

[list=A]
The Start: My client has a suscription driven site and he wants to know how his suscribers find his site. So he asked me to come out with the best solution.

Solution: Since the tracking device has to be set to every page(at least the ones that are indexed in the robots), which are a lot since the site is a big one, I decided that the best to go was with javascript.

Creation: By giving a solution now I had to create it and test it. I created a ".js" file, made some test pages and statrted the testing.

Testing: I made a lot of testings since I only want the cookie to capture the FIRST arrival and not each. It worked well, I was able to capture the referrer and the retrieve it. But when I made my final test, I found a problem.

The Problem: I thought that all was going great and I should be by bed in no time, but I found a "bug" in my code. The problem is that when you access the site via "www.mysite.com" it retrieves and writes a different cookie when you are in "mysite.com". Since I never really worked with cookies I didn't know how to solve this.
[/list=A]

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

khalidali63
04-07-2003, 08:31 AM
I think if you named your cookies in a standard way then you should be able to retrieved them from any domain.

Cheers

Khalid

kidd
04-07-2003, 08:33 AM
Thanks for your reply....

I just don't understant what do you mean in a standard way....

khalidali63
04-07-2003, 01:50 PM
I meant "standard" which you'd follow along allof your pages and domains.
say if you set a cookie name "cookie-www.mydomain.com"
the in all of the pages you should be able to get this cookie with the same name

Khalid