Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


cookie problem with www and with out it

Posted on 2003-02-18
Medium Priority
Last Modified: 2006-11-17
I am using a cookie to try to store an affiliate tracking ID when a visitor first comes to our website like:


I did some tests and everything works fine until I type:


into the browser, then go check my cookie folder and it shows 2 cookie for the same site.  one is labeled:

and the other is:

I tried messing with the path and domain arguments of the setcookie() function but it still hasn't fixed the problem

here is the current setcookie function call from my script:
setcookie("affid", $affid, time()+31536000,"www.careonecard.com");

The problem is that when a visitor comes to the website without an affiliate ID a default "company" ID is used and that will make the affiliate that referred the visitor to our site loose their credit of the sale if the visitor comes back at a later date and doesn't type in www.careonecard.com.

Any ideas on how to correct this issue?
Question by:therealsyko

Author Comment

ID: 7979056
found the answer!

I was missing an argument for the path, and the domain argument should be "careonecard.com"

Please don't respond to this question, I am going to try to get it deleted.

Sorry!  I will try to stop answering my own questions so quickly!  :D

LVL 40

Expert Comment

by:Richard Quadling
ID: 7980825
Ha. I had the exactly the same issue! Thanks.

Accepted Solution

modulo earned 0 total points
ID: 7981243
PAQ'd and points refunded


Community Support Moderator
Experts Exchange

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses four methods for overlaying images in a container on a web page
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

577 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question