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
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
This article discusses how to implement server side field validation and display customized error messages to the client.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
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

770 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