dcsimg
www.webdeveloper.com
Results 1 to 4 of 4

Thread: Cookie Trouble

  1. #1
    Join Date
    Apr 2003
    Posts
    2

    Exclamation Cookie Trouble

    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

  2. #2
    Join Date
    Dec 2002
    Location
    Calgary, Canada
    Posts
    2,653
    I think if you named your cookies in a standard way then you should be able to retrieved them from any domain.

    Cheers

    Khalid

  3. #3
    Join Date
    Apr 2003
    Posts
    2
    Thanks for your reply....

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

  4. #4
    Join Date
    Dec 2002
    Location
    Calgary, Canada
    Posts
    2,653
    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

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles